Lines Matching refs:data

97                               struct Curl_easy *data,
100 (void)data;
113 struct Curl_easy *data,
120 failf(data, "%s cannot be done over CONNECT", cf->conn->handler->scheme);
125 result = Curl_get_upload_buffer(data);
133 infof(data, "allocate connect buffer");
137 Curl_httpchunk_init(data, &ts->ch, TRUE);
141 return tunnel_reinit(cf, data, ts);
147 struct Curl_easy *data)
154 CURL_TRC_CF(data, cf, "new tunnel state 'init'");
155 tunnel_reinit(cf, data, ts);
159 CURL_TRC_CF(data, cf, "new tunnel state 'connect'");
166 CURL_TRC_CF(data, cf, "new tunnel state 'receive'");
171 CURL_TRC_CF(data, cf, "new tunnel state 'response'");
176 CURL_TRC_CF(data, cf, "new tunnel state 'established'");
177 infof(data, "CONNECT phase completed");
178 data->state.authproxy.done = TRUE;
179 data->state.authproxy.multipass = FALSE;
183 CURL_TRC_CF(data, cf, "new tunnel state 'failed'");
188 data->info.httpcode = 0; /* clear it as it might've been used for the
193 Curl_safefree(data->state.aptr.proxyuserpwd);
195 data->state.hconnect = FALSE;
202 struct Curl_easy *data)
206 h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
209 Curl_httpchunk_free(data, &ts->ch);
217 struct Curl_easy *data,
227 Curl_safefree(data->req.newurl);
229 result = Curl_http_proxy_create_CONNECT(&req, cf, data, 1);
233 infof(data, "Establish HTTP proxy tunnel to %s", req->authority);
244 failf(data, "Failed sending CONNECT to proxy");
251 struct Curl_easy *data,
267 nwritten = cf->next->cft->do_send(cf->next, data, buf, blen, &result);
277 Curl_debug(data, CURLINFO_HEADER_OUT, buf, (size_t)nwritten);
281 failf(data, "Failed sending CONNECT to proxy");
287 struct Curl_easy *data,
292 struct SingleRequest *k = &data->req;
305 CURL_TRC_CF(data, cf, "CONNECT: fwd auth header '%s'", header);
306 result = Curl_http_input_auth(data, proxy, auth);
318 infof(data, "Ignoring Content-Length in CONNECT %03d response",
334 infof(data, "Ignoring Transfer-Encoding in "
340 infof(data, "CONNECT responded chunked");
343 Curl_httpchunk_reset(data, &ts->ch, TRUE);
356 data->info.httpproxycode = k->httpcode = (header[9] - '0') * 100 +
363 struct Curl_easy *data,
368 struct SingleRequest *k = &data->req;
369 curl_socket_t tunnelsocket = Curl_conn_cf_get_socket(cf, data);
380 if(!Curl_conn_data_pending(data, cf->sockindex))
389 result = Curl_read(data, tunnelsocket, &byte, 1, &nread);
394 if(Curl_pgrsUpdate(data))
403 if(data->set.proxyauth && data->state.authproxy.avail &&
404 data->state.aptr.proxyuserpwd) {
408 infof(data, "Proxy CONNECT connection closed");
412 failf(data, "Proxy CONNECT aborted");
435 /* now parse the chunked piece of data so that we can
437 result = Curl_httpchunk_read(data, &ts->ch, &byte, 1, &consumed);
440 if(Curl_httpchunk_is_done(data, &ts->ch)) {
442 infof(data, "chunk reading DONE");
450 failf(data, "CONNECT response too large");
463 Curl_debug(data, CURLINFO_HEADER_IN, linep, line_len);
468 result = Curl_client_write(data, writetype, linep, line_len);
472 result = Curl_bump_headersize(data, line_len, TRUE);
484 if((407 == k->httpcode) && !data->state.authproblem) {
491 infof(data, "Ignore %" CURL_FORMAT_CURL_OFF_T
495 infof(data, "Ignore chunked response-body");
501 CURL_TRC_CF(data, cf, "CONNECT: no content-length or chunked");
514 result = on_resp_header(cf, data, ts, linep);
524 if(!result && *done && data->info.httpproxycode/100 != 2) {
527 result = Curl_http_auth_act(data);
535 struct Curl_easy *data,
556 if(!Curl_checkProxyheaders(data, cf->conn, STRCONST("Host"))) {
570 struct Curl_easy *data,
574 struct hyptransfer *h = &data->hyp;
575 curl_socket_t tunnelsocket = Curl_conn_cf_get_socket(cf, data);
591 failf(data, "Couldn't create hyper IO");
595 /* tell Hyper how to read/write network data */
596 hyper_io_set_userdata(io, data);
601 data->state.hconnect = TRUE;
607 failf(data, "Couldn't create hyper executor");
615 failf(data, "Couldn't create hyper client options");
628 failf(data, "Couldn't create hyper client handshake");
636 failf(data, "Couldn't hyper_executor_push the handshake");
644 failf(data, "Couldn't hyper_executor_poll the handshake");
654 failf(data, "Couldn't hyper_request_new");
660 failf(data, "error setting method");
668 Curl_safefree(data->req.newurl);
670 result = CONNECT_host(cf, data, &authority, &host_header);
674 infof(data, "Establish HTTP proxy tunnel to %s", authority);
678 failf(data, "error setting path");
682 if(data->set.verbose) {
688 Curl_debug(data, CURLINFO_HEADER_OUT, se, strlen(se));
692 result = Curl_http_output_auth(data, conn, "CONNECT", HTTPREQ_GET,
702 failf(data, "error setting HTTP version");
709 failf(data, "hyper_request_headers");
714 result = Curl_hyper_header(data, headers, host_header);
720 if(data->state.aptr.proxyuserpwd) {
721 result = Curl_hyper_header(data, headers,
722 data->state.aptr.proxyuserpwd);
727 if(!Curl_checkProxyheaders(data, conn, STRCONST("User-Agent")) &&
728 data->set.str[STRING_USERAGENT] && *data->set.str[STRING_USERAGENT]) {
732 data->set.str[STRING_USERAGENT]);
735 result = Curl_hyper_header(data, headers, Curl_dyn_ptr(&ua));
741 if(!Curl_checkProxyheaders(data, conn, STRCONST("Proxy-Connection"))) {
742 result = Curl_hyper_header(data, headers,
748 result = Curl_add_custom_headers(data, TRUE, headers);
754 failf(data, "hyper_clientconn_send");
761 failf(data, "Couldn't hyper_executor_push the send");
788 struct Curl_easy *data,
792 struct hyptransfer *h = &data->hyp;
819 failf(data, "Hyper: %.*s", (int)errlen, errbuf);
826 struct Curl_easy *data,
830 struct hyptransfer *h = &data->hyp;
836 result = Curl_hyper_stream(data, cf->conn, &didwhat, done,
858 struct Curl_easy *data,
873 check = Curl_timeleft(data, NULL, TRUE);
875 failf(data, "Proxy CONNECT aborted due to timeout");
883 CURL_TRC_CF(data, cf, "CONNECT start");
884 result = start_CONNECT(cf, data, ts);
887 h1_tunnel_go_state(cf, ts, H1_TUNNEL_CONNECT, data);
892 CURL_TRC_CF(data, cf, "CONNECT send");
893 result = send_CONNECT(cf, data, ts, &done);
896 h1_tunnel_go_state(cf, ts, H1_TUNNEL_RECEIVE, data);
901 CURL_TRC_CF(data, cf, "CONNECT receive");
902 result = recv_CONNECT_resp(cf, data, ts, &done);
903 if(Curl_pgrsUpdate(data)) {
911 h1_tunnel_go_state(cf, ts, H1_TUNNEL_RESPONSE, data);
915 CURL_TRC_CF(data, cf, "CONNECT response");
916 if(data->req.newurl) {
927 CURL_TRC_CF(data, cf, "CONNECT need to close+open");
928 infof(data, "Connect me again please");
929 Curl_conn_cf_close(cf, data);
931 result = Curl_conn_cf_connect(cf->next, data, FALSE, &done);
936 h1_tunnel_go_state(cf, ts, H1_TUNNEL_INIT, data);
945 } while(data->req.newurl);
948 if(data->info.httpproxycode/100 != 2) {
950 Curl_safefree(data->req.newurl);
953 h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
954 failf(data, "CONNECT tunnel failed, response %d", data->req.httpcode);
958 h1_tunnel_go_state(cf, ts, H1_TUNNEL_ESTABLISHED, data);
959 infof(data, "CONNECT tunnel established, response %d",
960 data->info.httpproxycode);
965 h1_tunnel_go_state(cf, ts, H1_TUNNEL_FAILED, data);
970 struct Curl_easy *data,
981 CURL_TRC_CF(data, cf, "connect");
982 result = cf->next->cft->do_connect(cf->next, data, blocking, done);
988 result = tunnel_init(cf, data, &ts);
997 result = H1_CONNECT(cf, data, ts);
1000 Curl_safefree(data->state.aptr.proxyuserpwd);
1006 /* Restore `data->req` fields that may habe been touched */
1007 data->req.header = TRUE; /* assume header */
1008 data->req.bytecount = 0;
1009 data->req.ignorebody = FALSE;
1010 Curl_client_cleanup(data);
1011 Curl_pgrsSetUploadCounter(data, 0);
1012 Curl_pgrsSetDownloadCounter(data, 0);
1014 tunnel_free(cf, data);
1020 struct Curl_easy *data,
1028 curl_socket_t sock = Curl_conn_cf_get_socket(cf, data);
1035 Curl_pollset_set_out_only(data, ps, sock);
1037 Curl_pollset_set_in_only(data, ps, sock);
1040 Curl_pollset_set_out_only(data, ps, sock);
1045 struct Curl_easy *data)
1047 CURL_TRC_CF(data, cf, "destroy");
1048 tunnel_free(cf, data);
1052 struct Curl_easy *data)
1054 CURL_TRC_CF(data, cf, "close");
1057 h1_tunnel_go_state(cf, cf->ctx, H1_TUNNEL_INIT, data);
1060 cf->next->cft->do_close(cf->next, data);
1083 struct Curl_easy *data)
1088 (void)data;