fetch: support keep-alive even if the HTTP server returns 304 (Not-Modified).

This commit is contained in:
Juan RP
2015-04-13 12:05:40 +02:00
parent f78c2986d4
commit 15893caf0b
2 changed files with 5 additions and 3 deletions

View File

@ -704,8 +704,6 @@ http_connect(struct url *URL, struct url *purl, const char *flags, int *cached)
int val;
#endif
*cached = 1;
#ifdef INET6
af = AF_UNSPEC;
#else
@ -849,6 +847,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
length = -1;
size = -1;
mtime = 0;
cached = 0;
/* check port */
if (!url->port)
@ -1166,7 +1165,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
URL->offset = offset;
URL->length = clength;
if (clength == -1 && !chunked)
if (clength == -1 && !chunked && conn->err != HTTP_NOT_MODIFIED)
keep_alive = 0;
if (conn->err == HTTP_NOT_MODIFIED) {