llist: add Curl_llist_append()

- use for better readability in all places where the "insert_next"
  actually performs an append to the list
- add some tests in unit1300

Closes #13336
This commit is contained in:
Stefan Eissing 2024-04-10 11:51:08 +02:00 committed by Daniel Stenberg
parent 8cee4c9238
commit c296abd42d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 79 additions and 20 deletions

View file

@ -264,8 +264,7 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value,
newhs->value[olen + vlen] = 0; /* null-terminate at newline */
/* insert this node into the list of headers */
Curl_llist_insert_next(&data->state.httphdrs, data->state.httphdrs.tail,
newhs, &newhs->node);
Curl_llist_append(&data->state.httphdrs, newhs, &newhs->node);
data->state.prevhead = newhs;
return CURLE_OK;
}
@ -328,8 +327,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header,
hs->request = data->state.requests;
/* insert this node into the list of headers */
Curl_llist_insert_next(&data->state.httphdrs, data->state.httphdrs.tail,
hs, &hs->node);
Curl_llist_append(&data->state.httphdrs, hs, &hs->node);
data->state.prevhead = hs;
}
else