Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
If mirror is stored in http use If-Modified-Since (fixes #425)
Baptiste Daroussin committed 13 years ago
commit 5527865405de252ac7ab8c643e06c217909ccc7c
parent 2bdcde7
1 file changed +11 -1
modified libpkg/fetch.c
@@ -141,6 +141,9 @@ pkg_fetch_file_to_fd(const char *url, int dest, time_t t)
	retry = max_retry;

	u = fetchParseURL(url);
+
	if (t != 0)
+
		u->ims_time = t;
+

	doc = u->doc;
	while (remote == NULL) {
		if (retry == max_retry) {
@@ -179,8 +182,15 @@ pkg_fetch_file_to_fd(const char *url, int dest, time_t t)
			u->port = http_current->url->port;
		}

-
		remote = fetchXGet(u, &st, "");
+
		if (strncmp(u->scheme, "http", 4) == 0)
+
			remote = fetchXGetHTTP(u, &st, "i");
+
		else
+
			remote = fetchXGet(u, &st, "");
		if (remote == NULL) {
+
			if (fetchLastErrCode == FETCH_OK) {
+
				retcode = EPKG_UPTODATE;
+
				goto cleanup;
+
			}
			--retry;
			if (retry <= 0) {
				pkg_emit_error("%s: %s", url,