From 2bfd7597b7533894c71385f833a91b3d88ee8506 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Fri, 18 Dec 2015 01:42:15 -0500 Subject: snapshot of project "lynx", label v2-8-9dev_6r --- WWW/Library/Implementation/HTTP.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'WWW/Library/Implementation/HTTP.c') diff --git a/WWW/Library/Implementation/HTTP.c b/WWW/Library/Implementation/HTTP.c index 6a6eb2fc..61725f0d 100644 --- a/WWW/Library/Implementation/HTTP.c +++ b/WWW/Library/Implementation/HTTP.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTTP.c,v 1.149 2015/12/17 02:00:47 tom Exp $ + * $LynxId: HTTP.c,v 1.150 2015/12/18 01:20:22 tom Exp $ * * HyperText Tranfer Protocol - Client implementation HTTP.c * ========================== @@ -17,8 +17,6 @@ #include #endif -#define HTTP_VERSION "HTTP/1.1" - #define HTTP_PORT 80 #define HTTPS_PORT 443 #define SNEWS_PORT 563 @@ -1172,7 +1170,9 @@ static int HTLoadHTTP(const char *arg, } if (extensions) { BStrCat0(command, " "); - BStrCat0(command, HTTP_VERSION); + BStrCat0(command, ((HTprotocolLevel == HTTP_1_0) + ? "HTTP/1.0" + : "HTTP/1.1")); } BStrCat0(command, crlf); /* CR LF, as in rfc 977 */ @@ -1186,7 +1186,9 @@ static int HTLoadHTTP(const char *arg, HTBprintf(&command, "Host: %s%c%c", host, CR, LF); FREE(host); } - HTBprintf(&command, "Connection: close%c%c", CR, LF); + if (HTprotocolLevel >= HTTP_1_1) { + HTBprintf(&command, "Connection: close%c%c", CR, LF); + } if (!HTPresentations) HTFormatInit(); -- cgit 1.4.1-2-gfad0