Lines Matching refs:conn

168                               struct connectdata *conn)  in Curl_http_setup_conn()  argument
172 connkeep(conn, "HTTP default"); in Curl_http_setup_conn()
175 CURLcode result = Curl_conn_may_http3(data, conn); in Curl_http_setup_conn()
194 const struct connectdata *conn, in Curl_checkProxyheaders() argument
200 for(head = (conn->bits.proxy && data->set.sep_headers) ? in Curl_checkProxyheaders()
406 struct connectdata *conn) in http_perhapsrewind() argument
430 if(conn->bits.close) in http_perhapsrewind()
440 if((conn->http_ntlm_state != NTLMSTATE_NONE) || in http_perhapsrewind()
441 (conn->proxy_ntlm_state != NTLMSTATE_NONE)) { in http_perhapsrewind()
453 if((conn->http_negotiate_state != GSS_AUTHNONE) || in http_perhapsrewind()
454 (conn->proxy_negotiate_state != GSS_AUTHNONE)) { in http_perhapsrewind()
475 streamclose(conn, "Mid-auth HTTP and much data left to send"); in http_perhapsrewind()
491 struct connectdata *conn = data->conn; in Curl_http_auth_act() local
514 conn->httpversion > 11) { in Curl_http_auth_act()
516 connclose(conn, "Force HTTP/1.1 connection"); in Curl_http_auth_act()
521 if(conn->bits.proxy_user_passwd && in Curl_http_auth_act()
532 result = http_perhapsrewind(data, conn); in Curl_http_auth_act()
575 struct connectdata *conn, in output_auth_headers() argument
583 (void)conn; in output_auth_headers()
601 result = Curl_output_negotiate(data, conn, proxy); in output_auth_headers()
633 (proxy && conn->bits.proxy_user_passwd && in output_auth_headers()
634 !Curl_checkProxyheaders(data, conn, STRCONST("Proxy-authorization"))) || in output_auth_headers()
704 struct connectdata *conn, in Curl_http_output_auth() argument
722 (conn->bits.httpproxy && conn->bits.proxy_user_passwd) || in Curl_http_output_auth()
751 if(conn->bits.httpproxy && in Curl_http_output_auth()
752 (conn->bits.tunnel_proxy == (bit)proxytunnel)) { in Curl_http_output_auth()
753 result = output_auth_headers(data, conn, authproxy, request, path, TRUE); in Curl_http_output_auth()
769 || conn->bits.netrc in Curl_http_output_auth()
772 result = output_auth_headers(data, conn, authhost, request, path, FALSE); in Curl_http_output_auth()
794 struct connectdata *conn, in Curl_http_output_auth() argument
801 (void)conn; in Curl_http_output_auth()
831 struct connectdata *conn = data->conn; in Curl_http_input_auth() local
833 curlnegotiate *negstate = proxy ? &conn->proxy_negotiate_state : in Curl_http_input_auth()
834 &conn->http_negotiate_state; in Curl_http_input_auth()
857 (void) conn; /* In case conditionals make it unused. */ in Curl_http_input_auth()
884 CURLcode result = Curl_input_negotiate(data, conn, proxy, auth); in Curl_http_input_auth()
1010 DEBUGASSERT(data->conn); in http_should_fail()
1063 if((httpcode == 407) && !data->conn->bits.proxy_user_passwd) in http_should_fail()
1134 struct connectdata *conn = data->conn; in Curl_http_connect() local
1138 connkeep(conn, "HTTP default"); in Curl_http_connect()
1147 struct connectdata *conn, in Curl_http_getsock_do() argument
1151 (void)conn; in Curl_http_getsock_do()
1164 struct connectdata *conn = data->conn; in Curl_http_done() local
1179 !conn->bits.retry && in Curl_http_done()
1189 streamclose(conn, "Empty reply from server"); in Curl_http_done()
1206 const struct connectdata *conn) in Curl_use_http_1_1plus() argument
1208 if((data->state.httpversion == 10) || (conn->httpversion == 10)) in Curl_use_http_1_1plus()
1211 (conn->httpversion <= 10)) in Curl_use_http_1_1plus()
1219 const struct connectdata *conn) in get_http_string() argument
1221 if(Curl_conn_is_http3(data, conn, FIRSTSOCKET)) in get_http_string()
1223 if(Curl_conn_is_http2(data, conn, FIRSTSOCKET)) in get_http_string()
1225 if(Curl_use_http_1_1plus(data, conn)) in get_http_string()
1251 struct connectdata *conn = data->conn; in Curl_dynhds_add_custom() local
1264 proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy ? in Curl_dynhds_add_custom()
1366 else if((conn->httpversion >= 20) && in Curl_dynhds_add_custom()
1398 struct connectdata *conn = data->conn; in Curl_add_custom_headers() local
1411 proxy = conn->bits.httpproxy && !conn->bits.tunnel_proxy ? in Curl_add_custom_headers()
1513 else if((conn->httpversion >= 20) && in Curl_add_custom_headers()
1632 void Curl_http_method(struct Curl_easy *data, struct connectdata *conn, in Curl_http_method() argument
1637 if((conn->handler->protocol&(PROTO_FAMILY_HTTP|CURLPROTO_FTP)) && in Curl_http_method()
1686 CURLcode Curl_http_host(struct Curl_easy *data, struct connectdata *conn) in Curl_http_host() argument
1694 data->state.first_host = strdup(conn->host.name); 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()
1705 strcasecompare(data->state.first_host, conn->host.name))) { in Curl_http_host()
1750 const char *host = conn->host.name; in Curl_http_host()
1752 if(((conn->given->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS)) && in Curl_http_host()
1753 (conn->remote_port == PORT_HTTPS)) || in Curl_http_host()
1754 ((conn->given->protocol&(CURLPROTO_HTTP|CURLPROTO_WS)) && in Curl_http_host()
1755 (conn->remote_port == PORT_HTTP)) ) in Curl_http_host()
1758 aptr->host = aprintf("Host: %s%s%s\r\n", conn->bits.ipv6_ip ? "[" : "", in Curl_http_host()
1759 host, conn->bits.ipv6_ip ? "]" : ""); in Curl_http_host()
1762 conn->bits.ipv6_ip ? "[" : "", in Curl_http_host()
1763 host, conn->bits.ipv6_ip ? "]" : "", in Curl_http_host()
1764 conn->remote_port); in Curl_http_host()
1777 struct connectdata *conn, in Curl_http_target() argument
1790 if(conn->bits.httpproxy && !conn->bits.tunnel_proxy) { in Curl_http_target()
1804 if(conn->host.dispname != conn->host.name) { in Curl_http_target()
1805 uc = curl_url_set(h, CURLUPART_HOST, conn->host.name, 0); in Curl_http_target()
1872 (void)conn; /* not used in disabled-proxy builds */ in Curl_http_target()
1969 DEBUGASSERT(data->conn); in set_reader()
2080 Curl_use_http_1_1plus(data, data->conn) && in Curl_http_req_set_reader()
2081 (data->conn->httpversion >= 20)) { in Curl_http_req_set_reader()
2092 if(Curl_use_http_1_1plus(data, data->conn)) { in Curl_http_req_set_reader()
2095 data->req.upload_chunky = (data->conn->httpversion < 20); in Curl_http_req_set_reader()
2134 Curl_use_http_1_1plus(data, data->conn) && in addexpect()
2135 (data->conn->httpversion < 20)) { in addexpect()
2157 DEBUGASSERT(data->conn); in Curl_http_req_complete()
2240 struct connectdata *conn, in Curl_http_cookies() argument
2257 data->state.aptr.cookiehost : conn->host.name; in Curl_http_cookies()
2259 conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) || in Curl_http_cookies()
2376 struct connectdata *conn = data->conn; in Curl_http_firstwrite() local
2380 if(conn->bits.close) { in Curl_http_firstwrite()
2400 streamclose(conn, "already downloaded"); in Curl_http_firstwrite()
2428 streamclose(conn, "Simulated 304 handling"); in Curl_http_firstwrite()
2477 struct connectdata *conn = data->conn; in Curl_http() local
2492 switch(conn->alpn) { in Curl_http()
2494 DEBUGASSERT(Curl_conn_is_http3(data, conn, FIRSTSOCKET)); in Curl_http()
2498 if(!Curl_conn_is_http2(data, conn, FIRSTSOCKET) && in Curl_http()
2499 conn->bits.proxy && !conn->bits.tunnel_proxy in Curl_http()
2501 result = Curl_http2_switch(data, conn, FIRSTSOCKET); in Curl_http()
2507 DEBUGASSERT(Curl_conn_is_http2(data, conn, FIRSTSOCKET)); in Curl_http()
2514 if(Curl_http2_may_switch(data, conn, FIRSTSOCKET)) { in Curl_http()
2516 result = Curl_http2_switch(data, conn, FIRSTSOCKET); in Curl_http()
2530 result = Curl_http_host(data, conn); in Curl_http()
2538 Curl_http_method(data, conn, &request, &httpreq); in Curl_http()
2548 result = Curl_http_output_auth(data, conn, request, httpreq, in Curl_http()
2591 httpstring = get_http_string(data, conn); in Curl_http()
2604 result = Curl_http_target(data, conn, &req); in Curl_http()
2611 if(conn->bits.altused && !Curl_checkheaders(data, STRCONST("Alt-Used"))) { in Curl_http()
2613 conn->conn_to_host.name, conn->conn_to_port); in Curl_http()
2660 (conn->bits.httpproxy && in Curl_http()
2661 !conn->bits.tunnel_proxy && in Curl_http()
2663 !Curl_checkProxyheaders(data, conn, in Curl_http()
2686 if(!(conn->handler->flags&PROTOPT_SSL) && in Curl_http()
2687 conn->httpversion < 20 && in Curl_http()
2698 result = Curl_http_cookies(data, conn, &req); in Curl_http()
2700 if(!result && conn->handler->protocol&(CURLPROTO_WS|CURLPROTO_WSS)) in Curl_http()
2718 if((conn->httpversion >= 20) && data->req.upload_chunky) in Curl_http()
2788 checkprotoprefix(struct Curl_easy *data, struct connectdata *conn, in checkprotoprefix() argument
2792 if(conn->handler->protocol & CURLPROTO_RTSP) in checkprotoprefix()
2795 (void)conn; in checkprotoprefix()
2822 struct connectdata *conn = data->conn; in Curl_http_header() local
2832 ((data->conn->handler->flags & PROTOPT_SSL) || in Curl_http_header()
2842 enum alpnid id = (conn->httpversion == 30) ? ALPN_h3 : in Curl_http_header()
2843 (conn->httpversion == 20) ? ALPN_h2 : ALPN_h1; in Curl_http_header()
2844 return Curl_altsvc_parse(data, data->asi, v, id, conn->host.name, in Curl_http_header()
2845 curlx_uitous((unsigned int)conn->remote_port)); in Curl_http_header()
2868 streamclose(conn, "overflow content-length"); in Curl_http_header()
2912 streamclose(conn, "Connection: close used"); in Curl_http_header()
2915 if((conn->httpversion == 10) && in Curl_http_header()
2923 connkeep(conn, "Connection keep-alive"); in Curl_http_header()
2990 result = http_perhapsrewind(data, conn); in Curl_http_header()
3005 if((conn->httpversion == 10) && conn->bits.httpproxy && in Curl_http_header()
3013 connkeep(conn, "Proxy-Connection keep-alive"); /* do not close */ in Curl_http_header()
3016 else if((conn->httpversion == 11) && conn->bits.httpproxy && in Curl_http_header()
3022 connclose(conn, "Proxy-Connection: asked to close after done"); in Curl_http_header()
3038 struct negotiatedata *negdata = &conn->negotiate; in Curl_http_header()
3080 data->state.aptr.cookiehost : conn->host.name; in Curl_http_header()
3082 conn->handler->protocol&(CURLPROTO_HTTPS|CURLPROTO_WSS) || in Curl_http_header()
3098 ((conn->handler->flags & PROTOPT_SSL) || in Curl_http_header()
3109 Curl_hsts_parse(data->hsts, conn->host.name, v); in Curl_http_header()
3146 connclose(conn, "HTTP/1.1 transfer-encoding without chunks"); in Curl_http_header()
3170 if(conn->handler->protocol & CURLPROTO_RTSP) { in Curl_http_header()
3183 struct connectdata *conn) in Curl_http_statusline() argument
3197 if(conn->httpversion && in Curl_http_statusline()
3198 (k->httpversion/10 != conn->httpversion/10)) { in Curl_http_statusline()
3200 conn->httpversion/10, k->httpversion/10); in Curl_http_statusline()
3212 conn->httpversion = (unsigned char)k->httpversion; in Curl_http_statusline()
3238 connclose(conn, "HTTP/1.0 close after body"); in Curl_http_statusline()
3383 struct connectdata *conn = data->conn; in http_on_response() local
3392 if(conn->httpversion != 20) in http_on_response()
3429 if(conn->httpversion != 11) { in http_on_response()
3439 data->conn->bits.asks_multiplex = FALSE; in http_on_response()
3445 result = Curl_http2_upgrade(data, conn, FIRSTSOCKET, buf, blen); in http_on_response()
3486 data->conn->bits.asks_multiplex = FALSE; in http_on_response()
3490 if((k->size == -1) && !k->chunk && !conn->bits.close && in http_on_response()
3491 (conn->httpversion == 11) && in http_on_response()
3492 !(conn->handler->protocol & CURLPROTO_RTSP) && in http_on_response()
3501 streamclose(conn, "HTTP: No end-of-message indicator"); in http_on_response()
3507 if(conn->bits.close && in http_on_response()
3509 (conn->http_ntlm_state == NTLMSTATE_TYPE2)) || in http_on_response()
3511 (conn->proxy_ntlm_state == NTLMSTATE_TYPE2)))) { in http_on_response()
3517 if(conn->bits.close && in http_on_response()
3519 (conn->http_negotiate_state == GSS_AUTHRECV)) || in http_on_response()
3521 (conn->proxy_negotiate_state == GSS_AUTHRECV)))) { in http_on_response()
3525 if((conn->http_negotiate_state == GSS_AUTHDONE) && in http_on_response()
3527 conn->http_negotiate_state = GSS_AUTHSUCC; in http_on_response()
3529 if((conn->proxy_negotiate_state == GSS_AUTHDONE) && in http_on_response()
3531 conn->proxy_negotiate_state = GSS_AUTHSUCC; in http_on_response()
3560 if((!data->req.authneg) && !conn->bits.close && in http_on_response()
3591 streamclose(conn, in http_on_response()
3593 result = http_perhapsrewind(data, conn); in http_on_response()
3608 streamclose(conn, "Stop sending data before everything sent"); in http_on_response()
3641 && !Curl_conn_is_http2(data, conn, FIRSTSOCKET) in http_on_response()
3642 && !Curl_conn_is_http3(data, conn, FIRSTSOCKET)) in http_on_response()
3708 if(data->conn->handler->protocol & PROTO_FAMILY_HTTP) { in http_rw_hd()
3776 else if(data->conn->handler->protocol & CURLPROTO_RTSP) { in http_rw_hd()
3805 result = Curl_http_statusline(data, data->conn); in http_rw_hd()
3849 struct connectdata *conn = data->conn; in http_parse_headers() local
3872 checkprotoprefix(data, conn, in http_parse_headers()
3879 streamclose(conn, "bad HTTP: No end-of-message indicator"); in http_parse_headers()
3880 if(conn->httpversion >= 10) { in http_parse_headers()
3910 statusline st = checkprotoprefix(data, conn, in http_parse_headers()
3914 streamclose(conn, "bad HTTP: No end-of-message indicator"); in http_parse_headers()
3916 if(conn->httpversion >= 10) { in http_parse_headers()
4320 scheme = (data->conn && data->conn->handler->flags & PROTOPT_SSL) ? in Curl_http_req_to_h2()