Commit 09dbe46a authored by Alex Wauck's avatar Alex Wauck Committed by Timo Teräs

libfetch: minor HTTP handling improvement

The recent TCP_CORK change missed this bit of code.  This change
should improve performance a bit when making HTTP requests by calling
http_cmd only once instead of three times.
parent 104c65ab
......@@ -711,11 +711,8 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached)
/* fetch_connect() has already set an error code */
return (NULL);
if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) {
http_cmd(conn, "CONNECT %s:%d HTTP/1.1\r\n",
URL->host, URL->port);
http_cmd(conn, "Host: %s:%d\r\n",
URL->host, URL->port);
http_cmd(conn, "\r\n");
http_cmd(conn, "CONNECT %s:%d HTTP/1.1\r\nHost: %s:%d\r\n\r\n",
URL->host, URL->port, URL->host, URL->port);
if (http_get_reply(conn) != HTTP_OK) {
goto ouch;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment