mirror of
https://github.com/curl/curl.git
synced 2026-08-26 03:53:32 +03:00
http: h1/h2 proxy unification
- use shared code for setting up the CONNECT request when tunneling, used in HTTP/1.x and HTTP/2 proxying - eliminate use of Curl_buffer_send() and other manipulations of `data->req` or `data->state.ulbuf` Closes #11808
This commit is contained in:
parent
9c7165e96a
commit
bb4032a152
7 changed files with 258 additions and 229 deletions
24
lib/http1.c
24
lib/http1.c
|
|
@ -318,5 +318,29 @@ out:
|
|||
return nread;
|
||||
}
|
||||
|
||||
CURLcode Curl_h1_req_write_head(struct httpreq *req, int http_minor,
|
||||
struct dynbuf *dbuf)
|
||||
{
|
||||
CURLcode result;
|
||||
|
||||
result = Curl_dyn_addf(dbuf, "%s %s%s%s%s HTTP/1.%d\r\n",
|
||||
req->method,
|
||||
req->scheme? req->scheme : "",
|
||||
req->scheme? "://" : "",
|
||||
req->authority? req->authority : "",
|
||||
req->path? req->path : "",
|
||||
http_minor);
|
||||
if(result)
|
||||
goto out;
|
||||
|
||||
result = Curl_dynhds_h1_dprint(&req->headers, dbuf);
|
||||
if(result)
|
||||
goto out;
|
||||
|
||||
result = Curl_dyn_addn(dbuf, STRCONST("\r\n"));
|
||||
|
||||
out:
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* !CURL_DISABLE_HTTP */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue