Lines Matching refs:req
408 curl_off_t bytessent = data->req.writebytecount; in http_perhapsrewind()
416 bool abort_upload = (!data->req.upload_done && !little_upload_remains); in http_perhapsrewind()
477 data->req.size = 0; /* do not download any more than 0 bytes */ in http_perhapsrewind()
500 if(100 <= data->req.httpcode && data->req.httpcode <= 199) in Curl_http_auth_act()
508 ((data->req.httpcode == 401) || in Curl_http_auth_act()
509 (data->req.authneg && data->req.httpcode < 300))) { in Curl_http_auth_act()
522 ((data->req.httpcode == 407) || in Curl_http_auth_act()
523 (data->req.authneg && data->req.httpcode < 300))) { in Curl_http_auth_act()
539 Curl_safefree(data->req.newurl); in Curl_http_auth_act()
540 data->req.newurl = strdup(data->state.url); /* clone URL */ in Curl_http_auth_act()
541 if(!data->req.newurl) in Curl_http_auth_act()
544 else if((data->req.httpcode < 300) && in Curl_http_auth_act()
546 data->req.authneg) { in Curl_http_auth_act()
553 data->req.newurl = strdup(data->state.url); /* clone URL */ in Curl_http_auth_act()
554 if(!data->req.newurl) in Curl_http_auth_act()
559 if(http_should_fail(data, data->req.httpcode)) { in Curl_http_auth_act()
561 data->req.httpcode); in Curl_http_auth_act()
782 data->req.authneg = TRUE; in Curl_http_output_auth()
785 data->req.authneg = FALSE; in Curl_http_output_auth()
886 free(data->req.newurl); in Curl_http_input_auth()
887 data->req.newurl = strdup(data->state.url); in Curl_http_input_auth()
888 if(!data->req.newurl) in Curl_http_input_auth()
1181 (data->req.bytecount + in Curl_http_done()
1182 data->req.headerbytecount - in Curl_http_done()
1183 data->req.deductheadercount) <= 0) { in Curl_http_done()
1356 else if(data->req.authneg && in Curl_dynhds_add_custom()
1392 struct dynbuf *req in Curl_add_custom_headers() argument
1394 void *req in Curl_add_custom_headers()
1464 Curl_dyn_free(req); in Curl_add_custom_headers()
1503 else if(data->req.authneg && in Curl_add_custom_headers()
1525 result = Curl_hyper_header(data, req, compare); in Curl_add_custom_headers()
1527 result = Curl_dyn_addf(req, "%s\r\n", compare); in Curl_add_custom_headers()
1546 struct dynbuf *req in Curl_add_timecondition() argument
1548 void *req in Curl_add_timecondition()
1614 result = Curl_dyn_add(req, datestr); in Curl_add_timecondition()
1616 result = Curl_hyper_header(data, req, datestr); in Curl_add_timecondition()
1624 struct dynbuf *req) in Curl_add_timecondition() argument
1627 (void)req; in Curl_add_timecondition()
1645 if(data->req.no_body) in Curl_http_method()
1971 if(data->req.authneg) { in set_reader()
2044 if(data->state.resume_from && !data->req.authneg) { in http_resume()
2076 data->req.upload_chunky = in Curl_http_req_set_reader()
2079 if(data->req.upload_chunky && in Curl_http_req_set_reader()
2084 data->req.upload_chunky = FALSE; in Curl_http_req_set_reader()
2095 data->req.upload_chunky = (data->conn->httpversion < 20); in Curl_http_req_set_reader()
2104 data->req.upload_chunky = FALSE; in Curl_http_req_set_reader()
2107 if(data->req.upload_chunky) in Curl_http_req_set_reader()
2121 if(data->req.upgr101 != UPGR101_INIT) in addexpect()
2159 if(data->req.upload_chunky) { in Curl_http_req_complete()
2181 if(req_clen >= 0 && !data->req.upload_chunky && in Curl_http_req_complete()
2182 (data->req.authneg || in Curl_http_req_complete()
2353 curl_off_t total_len = data->req.authneg ? in Curl_http_range()
2377 struct SingleRequest *k = &data->req; in Curl_http_firstwrite()
2379 if(data->req.newurl) { in Curl_http_firstwrite()
2483 struct dynbuf req; in Curl_http() local
2594 Curl_dyn_init(&req, DYN_HTTP_REQUEST); in Curl_http()
2602 result = Curl_dyn_addf(&req, "%s ", request); in Curl_http()
2604 result = Curl_http_target(data, conn, &req); in Curl_http()
2606 Curl_dyn_free(&req); in Curl_http()
2615 Curl_dyn_free(&req); in Curl_http()
2621 Curl_dyn_addf(&req, in Curl_http()
2682 Curl_dyn_free(&req); in Curl_http()
2691 result = Curl_http2_request_upgrade(&req, data); in Curl_http()
2693 Curl_dyn_free(&req); in Curl_http()
2698 result = Curl_http_cookies(data, conn, &req); in Curl_http()
2701 result = Curl_ws_request(data, &req); in Curl_http()
2704 result = Curl_add_timecondition(data, &req); in Curl_http()
2706 result = Curl_add_custom_headers(data, FALSE, &req); in Curl_http()
2710 result = Curl_http_req_complete(data, &req, httpreq); in Curl_http()
2712 result = Curl_req_send(data, &req); in Curl_http()
2714 Curl_dyn_free(&req); in Curl_http()
2718 if((conn->httpversion >= 20) && data->req.upload_chunky) in Curl_http()
2722 data->req.upload_chunky = FALSE; in Curl_http()
2824 struct SingleRequest *k = &data->req; in Curl_http_header()
2971 !data->req.location) { in Curl_http_header()
2980 data->req.location = location; in Curl_http_header()
2983 DEBUGASSERT(!data->req.newurl); in Curl_http_header()
2984 data->req.newurl = strdup(data->req.location); /* clone */ in Curl_http_header()
2985 if(!data->req.newurl) in Curl_http_header()
3153 data->req.resp_trailer = TRUE; in Curl_http_header()
3185 struct SingleRequest *k = &data->req; in Curl_http_statusline()
3278 struct SingleRequest *k = &data->req; in Curl_http_size()
3279 if(data->req.ignore_cl || k->chunk) { in Curl_http_size()
3300 struct SingleRequest *k = &data->req; in verify_header()
3332 data->req.allheadercount += (unsigned int)delta; in Curl_bump_headersize()
3334 data->req.headerbytecount += (unsigned int)delta; in Curl_bump_headersize()
3335 if(data->req.allheadercount > max) in Curl_bump_headersize()
3336 bad = data->req.allheadercount; in Curl_bump_headersize()
3343 bad = data->req.allheadercount + delta; in Curl_bump_headersize()
3362 ((data->req.httpcode/100 == 1) ? CLIENTWRITE_1XX : 0); in http_write_header()
3372 data->req.deductheadercount = (100 <= data->req.httpcode && in http_write_header()
3373 199 >= data->req.httpcode) ? in http_write_header()
3374 data->req.headerbytecount : 0; in http_write_header()
3385 struct SingleRequest *k = &data->req; in http_on_response()
3508 (((data->req.httpcode == 401) && in http_on_response()
3510 ((data->req.httpcode == 407) && in http_on_response()
3518 (((data->req.httpcode == 401) && in http_on_response()
3520 ((data->req.httpcode == 407) && in http_on_response()
3526 (data->req.httpcode != 401)) { in http_on_response()
3530 (data->req.httpcode != 407)) { in http_on_response()
3537 if(data->req.upgr101 == UPGR101_WS) { in http_on_response()
3545 if(http_should_fail(data, data->req.httpcode)) { in http_on_response()
3560 if((!data->req.authneg) && !conn->bits.close && in http_on_response()
3598 DEBUGASSERT(!data->req.newurl); in http_on_response()
3599 data->req.newurl = strdup(data->state.url); in http_on_response()
3632 if(data->req.no_body) in http_on_response()
3670 struct SingleRequest *k = &data->req; in http_rw_hd()
3851 struct SingleRequest *k = &data->req; in http_parse_headers()
3980 if(!data->req.header) { in Curl_http_write_resp_hds()
3988 if(!result && !data->req.header) { in Curl_http_write_resp_hds()
3989 if(!data->req.no_body && Curl_dyn_len(&data->state.headerb)) { in Curl_http_write_resp_hds()
4012 if(result || data->req.done) in Curl_http_write_resp()
4020 DEBUGASSERT(!blen || !data->req.header); in Curl_http_write_resp()
4021 if(!data->req.header && (blen || is_eos)) { in Curl_http_write_resp()
4063 struct httpreq *req; in Curl_http_req_make() local
4067 if(m_len + 1 > sizeof(req->method)) in Curl_http_req_make()
4070 req = calloc(1, sizeof(*req)); in Curl_http_req_make()
4071 if(!req) in Curl_http_req_make()
4073 memcpy(req->method, method, m_len); in Curl_http_req_make()
4075 req->scheme = Curl_memdup0(scheme, s_len); in Curl_http_req_make()
4076 if(!req->scheme) in Curl_http_req_make()
4080 req->authority = Curl_memdup0(authority, a_len); in Curl_http_req_make()
4081 if(!req->authority) in Curl_http_req_make()
4085 req->path = Curl_memdup0(path, p_len); in Curl_http_req_make()
4086 if(!req->path) in Curl_http_req_make()
4089 Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST); in Curl_http_req_make()
4090 Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST); in Curl_http_req_make()
4094 if(result && req) in Curl_http_req_make()
4095 Curl_http_req_free(req); in Curl_http_req_make()
4096 *preq = result ? NULL : req; in Curl_http_req_make()
4100 static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url) in req_assign_url_authority() argument
4114 req->authority = NULL; in req_assign_url_authority()
4152 req->authority = strdup(Curl_dyn_ptr(&buf)); in req_assign_url_authority()
4153 if(!req->authority) in req_assign_url_authority()
4166 static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url) in req_assign_url_path() argument
4184 req->path = NULL; in req_assign_url_path()
4187 req->path = path; in req_assign_url_path()
4201 req->path = strdup(Curl_dyn_ptr(&buf)); in req_assign_url_path()
4202 if(!req->path) in req_assign_url_path()
4218 struct httpreq *req; in Curl_http_req_make2() local
4223 if(m_len + 1 > sizeof(req->method)) in Curl_http_req_make2()
4226 req = calloc(1, sizeof(*req)); in Curl_http_req_make2()
4227 if(!req) in Curl_http_req_make2()
4229 memcpy(req->method, method, m_len); in Curl_http_req_make2()
4231 uc = curl_url_get(url, CURLUPART_SCHEME, &req->scheme, 0); in Curl_http_req_make2()
4234 if(!req->scheme && scheme_default) { in Curl_http_req_make2()
4235 req->scheme = strdup(scheme_default); in Curl_http_req_make2()
4236 if(!req->scheme) in Curl_http_req_make2()
4240 result = req_assign_url_authority(req, url); in Curl_http_req_make2()
4243 result = req_assign_url_path(req, url); in Curl_http_req_make2()
4247 Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST); in Curl_http_req_make2()
4248 Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST); in Curl_http_req_make2()
4252 if(result && req) in Curl_http_req_make2()
4253 Curl_http_req_free(req); in Curl_http_req_make2()
4254 *preq = result ? NULL : req; in Curl_http_req_make2()
4258 void Curl_http_req_free(struct httpreq *req) in Curl_http_req_free() argument
4260 if(req) { in Curl_http_req_free()
4261 free(req->scheme); in Curl_http_req_free()
4262 free(req->authority); in Curl_http_req_free()
4263 free(req->path); in Curl_http_req_free()
4264 Curl_dynhds_free(&req->headers); in Curl_http_req_free()
4265 Curl_dynhds_free(&req->trailers); in Curl_http_req_free()
4266 free(req); in Curl_http_req_free()
4298 struct httpreq *req, struct Curl_easy *data) in Curl_http_req_to_h2() argument
4305 DEBUGASSERT(req); in Curl_http_req_to_h2()
4308 if(req->scheme) { in Curl_http_req_to_h2()
4309 scheme = req->scheme; in Curl_http_req_to_h2()
4311 else if(strcmp("CONNECT", req->method)) { in Curl_http_req_to_h2()
4325 if(req->authority) { in Curl_http_req_to_h2()
4326 authority = req->authority; in Curl_http_req_to_h2()
4329 e = Curl_dynhds_get(&req->headers, STRCONST("Host")); in Curl_http_req_to_h2()
4337 req->method, strlen(req->method)); in Curl_http_req_to_h2()
4346 if(!result && req->path) { in Curl_http_req_to_h2()
4348 req->path, strlen(req->path)); in Curl_http_req_to_h2()
4350 for(i = 0; !result && i < Curl_dynhds_count(&req->headers); ++i) { in Curl_http_req_to_h2()
4351 e = Curl_dynhds_getn(&req->headers, i); in Curl_http_req_to_h2()
4415 data->req.keepon |= KEEP_SEND; in http_exp100_continue()
4416 data->req.keepon &= ~KEEP_SEND_TIMED; in http_exp100_continue()
4446 data->req.keepon &= ~KEEP_SEND; in cr_exp100_read()
4447 data->req.keepon |= KEEP_SEND_TIMED; in cr_exp100_read()
4460 data->req.keepon &= ~KEEP_SEND; in cr_exp100_read()
4461 data->req.keepon |= KEEP_SEND_TIMED; in cr_exp100_read()
4481 data->req.keepon &= ~KEEP_SEND_TIMED; in cr_exp100_done()