summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/http1.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/http1.c')
-rw-r--r--Utilities/cmcurl/lib/http1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/Utilities/cmcurl/lib/http1.c b/Utilities/cmcurl/lib/http1.c
index 1ca7d41..182234c 100644
--- a/Utilities/cmcurl/lib/http1.c
+++ b/Utilities/cmcurl/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 */