From 43d63349b392b4c677506249f77ac7a2d297ccac Mon Sep 17 00:00:00 2001 From: ketmar Date: Sun, 5 Sep 2021 10:21:52 +0000 Subject: [PATCH] upgraded HTTP protocol to 1.1 FossilOrigin-Name: dd82d27289a6c8db83b85e4439c0a7e3ff8b4a9036ad6c12f633001b498d190a --- src/sylib/syren_http.c | 2 +- src/sylib/syren_proxy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sylib/syren_http.c b/src/sylib/syren_http.c index 336b35d..13393be 100644 --- a/src/sylib/syren_http.c +++ b/src/sylib/syren_http.c @@ -154,7 +154,7 @@ TSyResult SyHTTPBuildQuery (TSyHdrs *hdrs, const char *method, const TSyURL *url s = SySPrintf("%s %s://%s%s", mt, url->protostr, url->host, port); } else s = SySPrintf("%s ", mt); if (!s) return SY_ERROR; - tmp = SySPrintf("%s%s%s%s%s HTTP/1.0", s, url->dir, url->file, url->query, url->anchor); + tmp = SySPrintf("%s%s%s%s%s HTTP/1.1", s, url->dir, url->file, url->query, url->anchor); free(s); if (!tmp) return SY_ERROR; res = SyHdrAddLine(hdrs, tmp); free(tmp); if (res != SY_OK) return SY_ERROR; diff --git a/src/sylib/syren_proxy.c b/src/sylib/syren_proxy.c index 14fc78e..09f60dd 100644 --- a/src/sylib/syren_proxy.c +++ b/src/sylib/syren_proxy.c @@ -65,7 +65,7 @@ static TSyResult SyHTTPConnect (TSySocket *fd, TSyProxy *proxy, const char *host if (!proxy || !host || !host[0] || port < 1 || port > 65535) return SY_ERROR; SyMessage(pfn, SY_MSG_NOTICE, "CONNECTing to %s:%i", host, port); proxy->retCode = -1; /* unknown yet */ - if (SyTCPSendLine(pfn, 1, fd, "CONNECT %s:%i HTTP/1.0", host, port) != SY_OK) return SY_ERROR; + if (SyTCPSendLine(pfn, 1, fd, "CONNECT %s:%i HTTP/1.1", host, port) != SY_OK) return SY_ERROR; if (SyTCPSendLine(pfn, 1, fd, "Host: %s:%i", host, port) != SY_OK) return SY_ERROR; if (proxy->userAgent && *proxy->userAgent) { if (SyTCPSendLine(pfn, 1, fd, "User-Agent: %s", proxy->userAgent) != SY_OK) return SY_ERROR; -- 2.11.4.GIT