From ef6be35bae1fe501fecd9a2a21eb5d03ddff4243 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 4 Feb 2014 23:37:29 +0100 Subject: CURLOPT_HEADEROPT: added Modified the logic so that CURLOPT_HEADEROPT now controls if PROXYHEADER is actually used or not. --- lib/http.c | 4 ++-- lib/url.c | 8 ++++++++ lib/urldata.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/http.c b/lib/http.c index c0cb4c069..b316fb4c2 100644 --- a/lib/http.c +++ b/lib/http.c @@ -200,7 +200,7 @@ char *Curl_checkProxyheaders(const struct connectdata *conn, size_t thislen = strlen(thisheader); struct SessionHandle *data = conn->data; - for(head = (conn->bits.proxy && data->set.proxyheaders)? + for(head = (conn->bits.proxy && data->set.sep_headers)? data->set.proxyheaders:data->set.headers; head; head=head->next) { if(Curl_raw_nequal(head->data, thisheader, thislen)) @@ -1550,7 +1550,7 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn, { char *ptr; struct curl_slist *headers= - (is_proxy && conn->data->set.proxyheaders)? + (is_proxy && conn->data->set.sep_headers)? conn->data->set.proxyheaders:conn->data->set.headers; while(headers) { diff --git a/lib/url.c b/lib/url.c index 25bb04115..73ae3ec8a 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1081,6 +1081,14 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, data->set.proxyheaders = va_arg(param, struct curl_slist *); break; + case CURLOPT_HEADEROPT: + /* + * Set header option. + */ + arg = va_arg(param, long); + data->set.sep_headers = (arg & CURLHEADER_SEPARATE)? TRUE: FALSE; + break; + case CURLOPT_HTTP200ALIASES: /* * Set a list of aliases for HTTP 200 in response header diff --git a/lib/urldata.h b/lib/urldata.h index fd13eb981..19c79cfe8 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1467,6 +1467,7 @@ struct UserDefined { struct curl_slist *headers; /* linked list of extra headers */ struct curl_slist *proxyheaders; /* linked list of extra CONNECT headers */ struct curl_httppost *httppost; /* linked list of POST data */ + bool sep_headers; /* handle host and proxy headers separately */ bool cookiesession; /* new cookie session? */ bool crlf; /* convert crlf on ftp upload(?) */ struct curl_slist *quote; /* after connection is established */ -- cgit v1.2.3