diff --git a/NEWS b/NEWS index 3aedf854..b2ddd568 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,8 @@ xbps-0.45 (???): + * libfetch: added support for keep-alive connections even if the HTTP server returns + 304 (Not Modified). This is a noticable performance improvement for `xbps-install -S`. + * xbps now autoupdates itself when there's a package update. * xbps-uchroot(8): added -O option to use overlayfs to mount CHROOTDIR in diff --git a/lib/fetch/http.c b/lib/fetch/http.c index 98f69105..25840a4c 100644 --- a/lib/fetch/http.c +++ b/lib/fetch/http.c @@ -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) {