summaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/lib/http.c b/lib/http.c
index 06ab3f164..3f8c69e49 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2442,14 +2442,8 @@ static CURLcode http_cookies(struct Curl_easy *data,
if(data->cookies && data->state.cookie_engine) {
const char *host = data->state.aptr.cookiehost ?
data->state.aptr.cookiehost : conn->host.name;
- const bool secure_context =
- conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) ||
- curl_strequal("localhost", host) ||
- !strcmp(host, "127.0.0.1") ||
- !strcmp(host, "::1");
Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
- rc = Curl_cookie_getlist(data, data->cookies, host, data->state.up.path,
- secure_context, &list);
+ rc = Curl_cookie_getlist(data, conn, host, &list);
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
}
if(!rc) {
@@ -3334,14 +3328,8 @@ static CURLcode http_header_s(struct Curl_easy *data,
* real peer hostname. */
const char *host = data->state.aptr.cookiehost ?
data->state.aptr.cookiehost : conn->host.name;
- const bool secure_context =
- conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) ||
- curl_strequal("localhost", host) ||
- !strcmp(host, "127.0.0.1") ||
- !strcmp(host, "::1");
-
- Curl_share_lock(data, CURL_LOCK_DATA_COOKIE,
- CURL_LOCK_ACCESS_SINGLE);
+ const bool secure_context = Curl_secure_context(conn, host);
+ Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE);
Curl_cookie_add(data, data->cookies, TRUE, FALSE, v, host,
data->state.up.path, secure_context);
Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE);
@@ -4836,8 +4824,7 @@ static const struct Curl_crtype cr_exp100 = {
Curl_creader_def_needs_rewind,
Curl_creader_def_total_length,
Curl_creader_def_resume_from,
- Curl_creader_def_rewind,
- Curl_creader_def_unpause,
+ Curl_creader_def_cntrl,
Curl_creader_def_is_paused,
cr_exp100_done,
sizeof(struct cr_exp100_ctx)