mirror of
https://github.com/curl/curl.git
synced 2026-08-25 02:53:32 +03:00
Curl_checkheaders: make it available for IMAP and SMTP too
... not only HTTP uses this now. Closes #1875
This commit is contained in:
parent
7207aaa696
commit
02eb6184ad
5 changed files with 30 additions and 25 deletions
21
lib/http.c
21
lib/http.c
|
|
@ -172,27 +172,6 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* checkheaders() checks the linked list of custom HTTP headers for a
|
||||
* particular header (prefix).
|
||||
*
|
||||
* Returns a pointer to the first matching header or NULL if none matched.
|
||||
*/
|
||||
char *Curl_checkheaders(const struct connectdata *conn,
|
||||
const char *thisheader)
|
||||
{
|
||||
struct curl_slist *head;
|
||||
size_t thislen = strlen(thisheader);
|
||||
struct Curl_easy *data = conn->data;
|
||||
|
||||
for(head = data->set.headers;head; head=head->next) {
|
||||
if(strncasecompare(head->data, thisheader, thislen))
|
||||
return head->data;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* checkProxyHeaders() checks the linked list of custom proxy headers
|
||||
* if proxy headers are not available, then it will lookup into http header
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue