Lines Matching refs:state

174   if(data->state.httpwant == CURL_HTTP_VERSION_3ONLY) {  in Curl_http_setup_conn()
281 userp = &data->state.aptr.proxyuserpwd; in http_output_basic()
282 user = data->state.aptr.proxyuser; in http_output_basic()
283 pwd = data->state.aptr.proxypasswd; in http_output_basic()
289 userp = &data->state.aptr.userpwd; in http_output_basic()
290 user = data->state.aptr.user; in http_output_basic()
291 pwd = data->state.aptr.passwd; in http_output_basic()
336 userp = &data->state.aptr.userpwd; in http_output_bearer()
437 if((data->state.authproxy.picked == CURLAUTH_NTLM) || in http_perhapsrewind()
438 (data->state.authhost.picked == CURLAUTH_NTLM)) { in http_perhapsrewind()
450 if((data->state.authproxy.picked == CURLAUTH_NEGOTIATE) || in http_perhapsrewind()
451 (data->state.authhost.picked == CURLAUTH_NEGOTIATE)) { in http_perhapsrewind()
504 if(data->state.authproblem) in Curl_http_auth_act()
507 if((data->state.aptr.user || data->set.str[STRING_BEARER]) && in Curl_http_auth_act()
510 pickhost = pickoneauth(&data->state.authhost, authmask); in Curl_http_auth_act()
512 data->state.authproblem = TRUE; in Curl_http_auth_act()
513 if(data->state.authhost.picked == CURLAUTH_NTLM && in Curl_http_auth_act()
517 data->state.httpwant = CURL_HTTP_VERSION_1_1; in Curl_http_auth_act()
524 pickproxy = pickoneauth(&data->state.authproxy, in Curl_http_auth_act()
527 data->state.authproblem = TRUE; in Curl_http_auth_act()
540 data->req.newurl = strdup(data->state.url); /* clone URL */ in Curl_http_auth_act()
545 (!data->state.authhost.done) && in Curl_http_auth_act()
551 if((data->state.httpreq != HTTPREQ_GET) && in Curl_http_auth_act()
552 (data->state.httpreq != HTTPREQ_HEAD)) { in Curl_http_auth_act()
553 data->req.newurl = strdup(data->state.url); /* clone URL */ in Curl_http_auth_act()
556 data->state.authhost.done = TRUE; in Curl_http_auth_act()
636 (!proxy && data->state.aptr.user && in output_auth_headers()
670 proxy ? (data->state.aptr.proxyuser ? in output_auth_headers()
671 data->state.aptr.proxyuser : "") : in output_auth_headers()
672 (data->state.aptr.user ? in output_auth_headers()
673 data->state.aptr.user : "")); in output_auth_headers()
677 auth, data->state.aptr.user ? in output_auth_headers()
678 data->state.aptr.user : ""); in output_auth_headers()
717 authhost = &data->state.authhost; in Curl_http_output_auth()
718 authproxy = &data->state.authproxy; in Curl_http_output_auth()
724 data->state.aptr.user || in Curl_http_output_auth()
847 authp = &data->state.authproxy; in Curl_http_input_auth()
851 authp = &data->state.authhost; in Curl_http_input_auth()
887 data->req.newurl = strdup(data->state.url); in Curl_http_input_auth()
890 data->state.authproblem = FALSE; in Curl_http_input_auth()
895 data->state.authproblem = TRUE; in Curl_http_input_auth()
913 data->state.authproblem = FALSE; in Curl_http_input_auth()
917 data->state.authproblem = TRUE; in Curl_http_input_auth()
941 data->state.authproblem = TRUE; in Curl_http_input_auth()
958 data->state.authproblem = TRUE; in Curl_http_input_auth()
973 data->state.authproblem = TRUE; in Curl_http_input_auth()
1029 if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET && in http_should_fail()
1060 if((httpcode == 401) && !data->state.aptr.user) in http_should_fail()
1067 return data->state.authproblem; in http_should_fail()
1168 data->state.authhost.multipass = FALSE; in Curl_http_done()
1169 data->state.authproxy.multipass = FALSE; in Curl_http_done()
1171 Curl_dyn_reset(&data->state.headerb); in Curl_http_done()
1208 if((data->state.httpversion == 10) || (conn->httpversion == 10)) in Curl_use_http_1_1plus()
1210 if((data->state.httpwant == CURL_HTTP_VERSION_1_0) && in Curl_use_http_1_1plus()
1213 return ((data->state.httpwant == CURL_HTTP_VERSION_NONE) || in Curl_use_http_1_1plus()
1214 (data->state.httpwant >= CURL_HTTP_VERSION_1_1)); in Curl_use_http_1_1plus()
1343 if(data->state.aptr.host && in Curl_dynhds_add_custom()
1348 else if(data->state.httpreq == HTTPREQ_POST_FORM && in Curl_dynhds_add_custom()
1352 else if(data->state.httpreq == HTTPREQ_POST_MIME && in Curl_dynhds_add_custom()
1361 else if(data->state.aptr.te && in Curl_dynhds_add_custom()
1489 if(data->state.aptr.host && in Curl_add_custom_headers()
1495 else if(data->state.httpreq == HTTPREQ_POST_FORM && in Curl_add_custom_headers()
1499 else if(data->state.httpreq == HTTPREQ_POST_MIME && in Curl_add_custom_headers()
1508 else if(data->state.aptr.te && in Curl_add_custom_headers()
1635 Curl_HttpReq httpreq = (Curl_HttpReq)data->state.httpreq; in Curl_http_method()
1638 data->state.upload) in Curl_http_method()
1679 free(data->state.aptr.uagent); in Curl_http_useragent()
1680 data->state.aptr.uagent = NULL; in Curl_http_useragent()
1689 struct dynamically_allocated_data *aptr = &data->state.aptr; in Curl_http_host()
1690 if(!data->state.this_is_a_follow) { in Curl_http_host()
1692 free(data->state.first_host); in Curl_http_host()
1694 data->state.first_host = strdup(conn->host.name); in Curl_http_host()
1695 if(!data->state.first_host) in Curl_http_host()
1698 data->state.first_remote_port = conn->remote_port; in Curl_http_host()
1699 data->state.first_remote_protocol = conn->handler->protocol; in Curl_http_host()
1704 if(ptr && (!data->state.this_is_a_follow || in Curl_http_host()
1705 strcasecompare(data->state.first_host, conn->host.name))) { in Curl_http_host()
1781 const char *path = data->state.up.path; in Curl_http_target()
1782 const char *query = data->state.up.query; in Curl_http_target()
1800 CURLU *h = curl_url_dup(data->state.uh); in Curl_http_target()
1817 if(strcasecompare("http", data->state.up.scheme)) { in Curl_http_target()
1846 if(strcasecompare("ftp", data->state.up.scheme)) { in Curl_http_target()
1862 data->state.prefer_ascii ? 'a' : 'i'); in Curl_http_target()
1893 data->state.mimepost = &data->set.mimepost; in set_post_reader()
1900 if(!data->state.formp) { in set_post_reader()
1901 data->state.formp = calloc(1, sizeof(curl_mimepart)); in set_post_reader()
1902 if(!data->state.formp) in set_post_reader()
1904 Curl_mime_cleanpart(data->state.formp); in set_post_reader()
1905 result = Curl_getformdata(data, data->state.formp, data->set.httppost, in set_post_reader()
1906 data->state.fread_func); in set_post_reader()
1908 Curl_safefree(data->state.formp); in set_post_reader()
1911 data->state.mimepost = data->state.formp; in set_post_reader()
1916 data->state.mimepost = NULL; in set_post_reader()
1925 if(data->state.mimepost) { in set_post_reader()
1929 data->state.mimepost->flags |= MIME_BODY_ONLY; in set_post_reader()
1936 else if(data->state.mimepost->kind == MIMEKIND_MULTIPART) in set_post_reader()
1939 curl_mime_headers(data->state.mimepost, data->set.headers, 0); in set_post_reader()
1940 result = Curl_mime_prepare_headers(data, data->state.mimepost, cthdr, in set_post_reader()
1944 curl_mime_headers(data->state.mimepost, NULL, 0); in set_post_reader()
1945 result = Curl_creader_set_mime(data, data->state.mimepost); in set_post_reader()
1954 data->state.infilesize = Curl_creader_total_length(data); in set_post_reader()
1967 curl_off_t postsize = data->state.infilesize; in set_reader()
2017 data->state.infilesize = 0; in set_reader()
2026 data->state.resume_from) { in http_resume()
2036 if(data->state.resume_from < 0) { in http_resume()
2041 data->state.resume_from = 0; in http_resume()
2044 if(data->state.resume_from && !data->req.authneg) { in http_resume()
2047 result = Curl_creader_resume_from(data, data->state.resume_from); in http_resume()
2050 data->state.resume_from); in http_resume()
2133 else if(!data->state.disableexpect && in addexpect()
2194 if(data->state.mimepost && in Curl_http_req_complete()
2198 for(hdr = data->state.mimepost->curlheaders; hdr; hdr = hdr->next) { in Curl_http_req_complete()
2255 if(data->cookies && data->state.cookie_engine) { in Curl_http_cookies()
2256 const char *host = data->state.aptr.cookiehost ? in Curl_http_cookies()
2257 data->state.aptr.cookiehost : conn->host.name; in Curl_http_cookies()
2264 rc = Curl_cookie_getlist(data, data->cookies, host, data->state.up.path, in Curl_http_cookies()
2320 if(data->state.use_range) { in Curl_http_range()
2329 free(data->state.aptr.rangeline); in Curl_http_range()
2330 data->state.aptr.rangeline = aprintf("Range: bytes=%s\r\n", in Curl_http_range()
2331 data->state.range); in Curl_http_range()
2337 free(data->state.aptr.rangeline); in Curl_http_range()
2343 data->state.aptr.rangeline = in Curl_http_range()
2348 else if(data->state.resume_from) { in Curl_http_range()
2354 data->state.infilesize : in Curl_http_range()
2355 (data->state.resume_from + req_clen); in Curl_http_range()
2356 data->state.aptr.rangeline = in Curl_http_range()
2358 data->state.range, total_len-1, total_len); in Curl_http_range()
2363 data->state.aptr.rangeline = in Curl_http_range()
2365 data->state.range, req_clen); in Curl_http_range()
2367 if(!data->state.aptr.rangeline) in Curl_http_range()
2392 if(data->state.resume_from && !k->content_range && in Curl_http_firstwrite()
2393 (data->state.httpreq == HTTPREQ_GET) && in Curl_http_firstwrite()
2396 if(k->size == data->state.resume_from) { in Curl_http_firstwrite()
2415 if(data->set.timecondition && !data->state.range) { in Curl_http_firstwrite()
2449 Curl_safefree(data->state.aptr.te); in Curl_transferencode()
2458 data->state.aptr.te = aprintf("Connection: %s%sTE\r\n" TE_HEADER, in Curl_transferencode()
2462 if(!data->state.aptr.te) in Curl_transferencode()
2543 if(data->state.up.query) { in Curl_http()
2544 pq = aprintf("%s?%s", data->state.up.path, data->state.up.query); in Curl_http()
2549 (pq ? pq : data->state.up.path), FALSE); in Curl_http()
2555 Curl_safefree(data->state.aptr.ref); in Curl_http()
2556 if(data->state.referer && !Curl_checkheaders(data, STRCONST("Referer"))) { in Curl_http()
2557 data->state.aptr.ref = aprintf("Referer: %s\r\n", data->state.referer); in Curl_http()
2558 if(!data->state.aptr.ref) in Curl_http()
2564 Curl_safefree(data->state.aptr.accept_encoding); in Curl_http()
2565 data->state.aptr.accept_encoding = in Curl_http()
2567 if(!data->state.aptr.accept_encoding) in Curl_http()
2571 Curl_safefree(data->state.aptr.accept_encoding); in Curl_http()
2598 Curl_dyn_reset(&data->state.headerb); in Curl_http()
2637 (data->state.aptr.host ? data->state.aptr.host : ""), in Curl_http()
2639 data->state.aptr.proxyuserpwd ? in Curl_http()
2640 data->state.aptr.proxyuserpwd : "", in Curl_http()
2644 data->state.aptr.userpwd ? data->state.aptr.userpwd : "", in Curl_http()
2645 (data->state.use_range && data->state.aptr.rangeline) ? in Curl_http()
2646 data->state.aptr.rangeline : "", in Curl_http()
2649 data->state.aptr.uagent) ? in Curl_http()
2650 data->state.aptr.uagent : "", in Curl_http()
2652 data->state.aptr.te ? data->state.aptr.te : "", in Curl_http()
2655 data->state.aptr.accept_encoding) ? in Curl_http()
2656 data->state.aptr.accept_encoding : "", in Curl_http()
2657 (data->state.referer && data->state.aptr.ref) ? in Curl_http()
2658 data->state.aptr.ref : "" /* Referer: <data> */, in Curl_http()
2675 Curl_safefree(data->state.aptr.userpwd); in Curl_http()
2677 Curl_safefree(data->state.aptr.proxyuserpwd); in Curl_http()
2688 (data->state.httpwant == CURL_HTTP_VERSION_2)) { in Curl_http()
2949 if(data->state.resume_from == k->offset) in Curl_http_header()
2955 data->state.resume_from = 0; /* get everything */ in Curl_http_header()
2995 data->state.this_is_a_follow = TRUE; in Curl_http_header()
3039 struct auth *authp = &data->state.authhost; in Curl_http_header()
3074 v = (data->cookies && data->state.cookie_engine) ? in Curl_http_header()
3079 const char *host = data->state.aptr.cookiehost ? in Curl_http_header()
3080 data->state.aptr.cookiehost : conn->host.name; in Curl_http_header()
3090 data->state.up.path, secure_context); in Curl_http_header()
3133 (data->state.httpreq != HTTPREQ_HEAD) && in Curl_http_header()
3214 if(!data->state.httpversion || data->state.httpversion > k->httpversion) in Curl_http_statusline()
3216 data->state.httpversion = (unsigned char)k->httpversion; in Curl_http_statusline()
3226 if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET && in Curl_http_statusline()
3493 data->state.httpreq != HTTPREQ_HEAD) { in http_on_response()
3513 data->state.authproblem = TRUE; in http_on_response()
3523 data->state.authproblem = TRUE; in http_on_response()
3573 switch(data->state.httpreq) { in http_on_response()
3597 data->state.disableexpect = TRUE; in http_on_response()
3599 data->req.newurl = strdup(data->state.url); in http_on_response()
3688 Curl_dyn_reset(&data->state.headerb); in http_rw_hd()
3864 result = Curl_dyn_addn(&data->state.headerb, buf, blen); in http_parse_headers()
3873 Curl_dyn_ptr(&data->state.headerb), in http_parse_headers()
3874 Curl_dyn_len(&data->state.headerb)); in http_parse_headers()
3897 result = Curl_dyn_addn(&data->state.headerb, buf, consumed); in http_parse_headers()
3911 Curl_dyn_ptr(&data->state.headerb), in http_parse_headers()
3912 Curl_dyn_len(&data->state.headerb)); in http_parse_headers()
3930 result = http_rw_hd(data, Curl_dyn_ptr(&data->state.headerb), in http_parse_headers()
3931 Curl_dyn_len(&data->state.headerb), in http_parse_headers()
3936 Curl_dyn_reset(&data->state.headerb); in http_parse_headers()
3951 Curl_dyn_free(&data->state.headerb); in http_parse_headers()
3989 if(!data->req.no_body && Curl_dyn_len(&data->state.headerb)) { in Curl_http_write_resp_hds()
3994 Curl_dyn_ptr(&data->state.headerb), in Curl_http_write_resp_hds()
3995 Curl_dyn_len(&data->state.headerb)); in Curl_http_write_resp_hds()
3997 Curl_dyn_free(&data->state.headerb); in Curl_http_write_resp_hds()
4404 enum expect100 state; member
4413 if(ctx->state > EXP100_SEND_DATA) { in http_exp100_continue()
4414 ctx->state = EXP100_SEND_DATA; in http_exp100_continue()
4429 switch(ctx->state) { in cr_exp100_read()
4443 ctx->state = EXP100_AWAITING_CONTINUE; in cr_exp100_read()
4480 ctx->state = premature ? EXP100_FAILED : EXP100_SEND_DATA; in cr_exp100_done()
4511 ctx->state = EXP100_SENDING_REQUEST; in http_exp100_add_reader()
4531 return (ctx->state == EXP100_AWAITING_CONTINUE); in http_exp100_is_waiting()