Lines Matching +full:check +full:- +full:merge +full:- +full:request
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
21 * SPDX-License-Identifier: curl
49 h->name = hs->name; in copy_header_external()
50 h->value = hs->value; in copy_header_external()
51 h->amount = amount; in copy_header_external()
52 h->index = index; in copy_header_external()
57 h->origin = hs->type | (1<<27); in copy_header_external()
58 h->anchor = e; in copy_header_external()
66 int request, in curl_easy_header() argument
78 CURLH_PSEUDO)) || !type || (request < -1)) in curl_easy_header()
80 if(!Curl_llist_count(&data->state.httphdrs)) in curl_easy_header()
82 if(request > data->state.requests) in curl_easy_header()
84 if(request == -1) in curl_easy_header()
85 request = data->state.requests; in curl_easy_header()
88 for(e = data->state.httphdrs.head; e; e = e->next) { in curl_easy_header()
89 hs = e->ptr; in curl_easy_header()
90 if(strcasecompare(hs->name, name) && in curl_easy_header()
91 (hs->type & type) && in curl_easy_header()
92 (hs->request == request)) { in curl_easy_header()
103 if(nameindex == amount - 1) in curl_easy_header()
107 for(e = data->state.httphdrs.head; e; e = e->next) { in curl_easy_header()
108 hs = e->ptr; in curl_easy_header()
109 if(strcasecompare(hs->name, name) && in curl_easy_header()
110 (hs->type & type) && in curl_easy_header()
111 (hs->request == request) && in curl_easy_header()
122 &data->state.headerout[0]); in curl_easy_header()
123 *hout = &data->state.headerout[0]; in curl_easy_header()
130 int request, in curl_easy_nextheader() argument
140 if(request > data->state.requests) in curl_easy_nextheader()
142 if(request == -1) in curl_easy_nextheader()
143 request = data->state.requests; in curl_easy_nextheader()
146 pick = prev->anchor; in curl_easy_nextheader()
150 pick = pick->next; in curl_easy_nextheader()
153 pick = data->state.httphdrs.head; in curl_easy_nextheader()
158 hs = pick->ptr; in curl_easy_nextheader()
159 if((hs->type & type) && (hs->request == request)) in curl_easy_nextheader()
161 pick = pick->next; in curl_easy_nextheader()
169 hs = pick->ptr; in curl_easy_nextheader()
173 for(e = data->state.httphdrs.head; e; e = e->next) { in curl_easy_nextheader()
174 struct Curl_header_store *check = e->ptr; in curl_easy_nextheader() local
175 if(strcasecompare(hs->name, check->name) && in curl_easy_nextheader()
176 (check->request == request) && in curl_easy_nextheader()
177 (check->type & type)) in curl_easy_nextheader()
180 index = amount - 1; in curl_easy_nextheader()
184 &data->state.headerout[1]); in curl_easy_nextheader()
185 return &data->state.headerout[1]; in curl_easy_nextheader()
191 char *end = header + hlen - 1; /* point to the last byte */ in namevalue()
219 *end-- = 0; /* nul terminate */ in namevalue()
231 DEBUGASSERT(data->state.prevhead); in unfold_value()
232 hs = data->state.prevhead; in unfold_value()
233 olen = strlen(hs->value); in unfold_value()
234 offset = hs->value - hs->buffer; in unfold_value()
238 while(vlen && ISSPACE(value[vlen - 1])) in unfold_value()
239 vlen--; in unfold_value()
243 vlen--; in unfold_value()
248 first be unlinked from the list and then re-added again after the in unfold_value()
250 Curl_llist_remove(&data->state.httphdrs, &hs->node, NULL); in unfold_value()
256 /* ->name and ->value point into ->buffer (to keep the header allocation in unfold_value()
259 newhs->name = newhs->buffer; in unfold_value()
260 newhs->value = &newhs->buffer[offset]; in unfold_value()
263 memcpy(&newhs->value[olen], value, vlen); in unfold_value()
264 newhs->value[olen + vlen] = 0; /* null-terminate at newline */ in unfold_value()
267 Curl_llist_append(&data->state.httphdrs, newhs, &newhs->node); in unfold_value()
268 data->state.prevhead = newhs; in unfold_value()
298 hlen = end - header; in Curl_headers_push()
301 if(data->state.prevhead) in Curl_headers_push()
309 hlen--; in Curl_headers_push()
315 if(Curl_llist_count(&data->state.httphdrs) >= MAX_HTTP_RESP_HEADER_COUNT) { in Curl_headers_push()
323 memcpy(hs->buffer, header, hlen); in Curl_headers_push()
324 hs->buffer[hlen] = 0; /* nul terminate */ in Curl_headers_push()
326 result = namevalue(hs->buffer, hlen, type, &name, &value); in Curl_headers_push()
328 hs->name = name; in Curl_headers_push()
329 hs->value = value; in Curl_headers_push()
330 hs->type = type; in Curl_headers_push()
331 hs->request = data->state.requests; in Curl_headers_push()
334 Curl_llist_append(&data->state.httphdrs, hs, &hs->node); in Curl_headers_push()
335 data->state.prevhead = hs; in Curl_headers_push()
347 Curl_llist_init(&data->state.httphdrs, NULL); in headers_reset()
348 data->state.prevhead = NULL; in headers_reset()
366 CURL_TRC_WRITE(data, "header_collect pushed(type=%x, len=%zu) -> %d", in hds_cw_collect_write()
371 return Curl_cwriter_write(data, writer->next, type, buf, blen); in hds_cw_collect_write()
375 "hds-collect",
388 if(data->conn && (data->conn->handler->protocol & PROTO_FAMILY_HTTP)) { in Curl_headers_init()
415 for(e = data->state.httphdrs.head; e; e = n) { in Curl_headers_cleanup()
416 struct Curl_header_store *hs = e->ptr; in Curl_headers_cleanup()
417 n = e->next; in Curl_headers_cleanup()
424 #else /* HTTP-disabled builds below */
430 int request, in curl_easy_header() argument
437 (void)request; in curl_easy_header()
444 int request, in curl_easy_nextheader() argument
449 (void)request; in curl_easy_nextheader()