Lines Matching refs:req
168 DEBUGASSERT(data->req.p.http == NULL);
174 data->req.p.http = http;
430 struct HTTP *http = data->req.p.http;
447 bytessent = data->req.writebytecount;
539 data->req.size = 0; /* don't download any more than 0 bytes */
572 if(100 <= data->req.httpcode && data->req.httpcode <= 199)
580 ((data->req.httpcode == 401) ||
581 (conn->bits.authneg && data->req.httpcode < 300))) {
594 ((data->req.httpcode == 407) ||
595 (conn->bits.authneg && data->req.httpcode < 300))) {
614 Curl_safefree(data->req.newurl);
615 data->req.newurl = strdup(data->state.url); /* clone URL */
616 if(!data->req.newurl)
619 else if((data->req.httpcode < 300) &&
628 data->req.newurl = strdup(data->state.url); /* clone URL */
629 if(!data->req.newurl)
636 data->req.httpcode);
970 free(data->req.newurl);
971 data->req.newurl = strdup(data->state.url);
972 if(!data->req.newurl)
1113 httpcode = data->req.httpcode;
1198 data->req.forbidchunk = (http->sending == HTTPSEND_REQUEST)?TRUE:FALSE;
1385 data->req.writebytecount += bodylen;
1386 Curl_pgrsSetUploadCounter(data, data->req.writebytecount);
1411 data->req.pendingheader = headersize - headlen;
1435 data->req.pendingheader = 0;
1539 struct HTTP *http = data->req.p.http;
1565 (data->req.bytecount +
1566 data->req.headerbytecount -
1567 data->req.deductheadercount) <= 0) {
1619 struct dynbuf *req)
1633 result = Curl_dyn_addn(req, STRCONST("Expect: 100-continue\r\n"));
1847 struct dynbuf *req
1849 void *req
1919 Curl_dyn_free(req);
1979 result = Curl_hyper_header(data, req, compare);
1981 result = Curl_dyn_addf(req, "%s\r\n", compare);
2000 struct dynbuf *req
2002 void *req
2068 result = Curl_dyn_add(req, datestr);
2070 result = Curl_hyper_header(data, req, datestr);
2078 struct dynbuf *req)
2081 (void)req;
2099 if(data->req.no_body)
2343 struct HTTP *http = data->req.p.http;
2403 data->req.upload_chunky =
2419 data->req.upload_chunky = TRUE;
2428 data->req.upload_chunky = FALSE;
2431 if(data->req.upload_chunky)
2442 if(data->req.upgr101 == UPGR101_INIT) {
2443 struct HTTP *http = data->req.p.http;
2471 struct HTTP *http = data->req.p.http;
2481 if((http->postsize != -1) && !data->req.upload_chunky &&
2504 result = Curl_buffer_send(r, data, data->req.p.http,
2526 result = Curl_buffer_send(r, data, data->req.p.http,
2542 if(http->postsize != -1 && !data->req.upload_chunky &&
2584 result = Curl_buffer_send(r, data, data->req.p.http,
2610 if((http->postsize != -1) && !data->req.upload_chunky &&
2649 if(!data->req.upload_chunky) {
2707 if(data->req.upload_chunky && conn->bits.authneg) {
2727 result = Curl_buffer_send(r, data, data->req.p.http,
2744 result = Curl_buffer_send(r, data, data->req.p.http,
2983 struct SingleRequest *k = &data->req;
2986 if(data->req.newurl) {
3091 struct dynbuf req;
3131 http = data->req.p.http;
3202 Curl_dyn_init(&req, DYN_HTTP_REQUEST);
3210 result = Curl_dyn_addf(&req, "%s ", request);
3212 result = Curl_http_target(data, conn, &req);
3214 Curl_dyn_free(&req);
3223 Curl_dyn_free(&req);
3229 Curl_dyn_addf(&req,
3285 Curl_dyn_free(&req);
3294 result = Curl_http2_request_upgrade(&req, data);
3296 Curl_dyn_free(&req);
3301 result = Curl_http_cookies(data, conn, &req);
3304 result = Curl_ws_request(data, &req);
3307 result = Curl_add_timecondition(data, &req);
3309 result = Curl_add_custom_headers(data, FALSE, &req);
3317 /* bodysend takes ownership of the 'req' memory on success */
3318 result = Curl_http_bodysend(data, conn, &req, httpreq);
3321 Curl_dyn_free(&req);
3326 (http->postsize <= data->req.writebytecount) &&
3328 data->req.upload_done = TRUE;
3330 if(data->req.writebytecount) {
3333 Curl_pgrsSetUploadCounter(data, data->req.writebytecount);
3342 data->req.writebytecount, http->postsize);
3343 data->req.upload_done = TRUE;
3344 data->req.keepon &= ~KEEP_SEND; /* we're done writing */
3345 data->req.exp100 = EXP100_SEND_DATA; /* already sent */
3350 if(data->req.upload_done)
3353 if((conn->httpversion >= 20) && data->req.upload_chunky)
3357 data->req.upload_chunky = FALSE;
3443 struct SingleRequest *k = &data->req;
3679 !data->req.location) {
3688 data->req.location = location;
3691 DEBUGASSERT(!data->req.newurl);
3692 data->req.newurl = strdup(data->req.location); /* clone */
3693 if(!data->req.newurl)
3769 struct SingleRequest *k = &data->req;
3847 struct SingleRequest *k = &data->req;
3848 if(data->req.ignore_cl || k->chunk) {
3865 struct SingleRequest *k = &data->req;
3899 data->req.allheadercount += (unsigned int)delta;
3901 data->req.headerbytecount += (unsigned int)delta;
3902 if(data->req.allheadercount > max)
3903 bad = data->req.allheadercount;
3910 bad = data->req.allheadercount + delta;
3928 struct SingleRequest *k = &data->req;
4116 (((data->req.httpcode == 401) &&
4118 ((data->req.httpcode == 407) &&
4126 (((data->req.httpcode == 401) &&
4128 ((data->req.httpcode == 407) &&
4134 (data->req.httpcode != 401)) {
4138 (data->req.httpcode != 407)) {
4172 if(data->req.upgr101 == UPGR101_WS) {
4179 data->req.deductheadercount =
4180 (100 <= k->httpcode && 199 >= k->httpcode)?data->req.headerbytecount:0;
4233 DEBUGASSERT(!data->req.newurl);
4234 data->req.newurl = strdup(data->state.url);
4277 if(data->req.no_body)
4515 if(!data->req.header) {
4523 if(!result && !data->req.header) {
4527 if(!data->req.no_body && Curl_dyn_len(&data->state.headerb)) {
4560 DEBUGASSERT(!blen || !data->req.header);
4561 if(!data->req.header && (blen || is_eos)) {
4603 struct httpreq *req;
4607 if(m_len + 1 > sizeof(req->method))
4610 req = calloc(1, sizeof(*req));
4611 if(!req)
4613 memcpy(req->method, method, m_len);
4615 req->scheme = Curl_memdup0(scheme, s_len);
4616 if(!req->scheme)
4620 req->authority = Curl_memdup0(authority, a_len);
4621 if(!req->authority)
4625 req->path = Curl_memdup0(path, p_len);
4626 if(!req->path)
4629 Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
4630 Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
4634 if(result && req)
4635 Curl_http_req_free(req);
4636 *preq = result? NULL : req;
4640 static CURLcode req_assign_url_authority(struct httpreq *req, CURLU *url)
4654 req->authority = NULL;
4692 req->authority = strdup(Curl_dyn_ptr(&buf));
4693 if(!req->authority)
4706 static CURLcode req_assign_url_path(struct httpreq *req, CURLU *url)
4724 req->path = NULL;
4727 req->path = path;
4741 req->path = strdup(Curl_dyn_ptr(&buf));
4742 if(!req->path)
4758 struct httpreq *req;
4763 if(m_len + 1 > sizeof(req->method))
4766 req = calloc(1, sizeof(*req));
4767 if(!req)
4769 memcpy(req->method, method, m_len);
4771 uc = curl_url_get(url, CURLUPART_SCHEME, &req->scheme, 0);
4774 if(!req->scheme && scheme_default) {
4775 req->scheme = strdup(scheme_default);
4776 if(!req->scheme)
4780 result = req_assign_url_authority(req, url);
4783 result = req_assign_url_path(req, url);
4787 Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
4788 Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
4792 if(result && req)
4793 Curl_http_req_free(req);
4794 *preq = result? NULL : req;
4798 void Curl_http_req_free(struct httpreq *req)
4800 if(req) {
4801 free(req->scheme);
4802 free(req->authority);
4803 free(req->path);
4804 Curl_dynhds_free(&req->headers);
4805 Curl_dynhds_free(&req->trailers);
4806 free(req);
4838 struct httpreq *req, struct Curl_easy *data)
4845 DEBUGASSERT(req);
4848 if(req->scheme) {
4849 scheme = req->scheme;
4851 else if(strcmp("CONNECT", req->method)) {
4865 if(req->authority) {
4866 authority = req->authority;
4869 e = Curl_dynhds_get(&req->headers, STRCONST("Host"));
4877 req->method, strlen(req->method));
4886 if(!result && req->path) {
4888 req->path, strlen(req->path));
4890 for(i = 0; !result && i < Curl_dynhds_count(&req->headers); ++i) {
4891 e = Curl_dynhds_getn(&req->headers, i);