Compare commits

...
4 Commits
32 ... 35
Author SHA1 Message Date
Arjan van de Ven a01ce4c329 dumb down due to limited infra 2016-11-01 13:17:49 +00:00
Arjan van de Ven 1eaaac582c use http/2 2016-11-01 12:56:35 +00:00
Arjan van de Ven 935dbee3c7 use CDN urls 2016-11-01 12:53:04 +00:00
Arjan van de Ven 0065ef2670 don't spew the journal 2016-11-01 12:52:17 +00:00
+5 -3
View File
@@ -55,8 +55,8 @@
static pthread_mutex_t dupes_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t dupes_mutex = PTHREAD_MUTEX_INITIALIZER;
char *urls[2] = { "https://debuginfo.clearlinux.org/debuginfo/", char *urls[2] = { "https://cdn.download.clearlinux.org/debuginfo/",
"https://debuginfo.clearlinux.org/debuginfo/" }; "https://cdn.download.clearlinux.org/debuginfo/" };
int urlcounter = 1; int urlcounter = 1;
static NcHashmap *hash = NULL; static NcHashmap *hash = NULL;
@@ -189,6 +189,7 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, file); curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
if (timestamp) { if (timestamp) {
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE); curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
@@ -322,6 +323,7 @@ static void *server_thread(void *arg)
} }
gettimeofday(&after, NULL); gettimeofday(&after, NULL);
#if 0
if (timedelta(before, after) > 0.6) if (timedelta(before, after) > 0.6)
printf("Request for %s took %5.2f seconds (%i - %i)\n", printf("Request for %s took %5.2f seconds (%i - %i)\n",
url, url,
@@ -329,7 +331,7 @@ static void *server_thread(void *arg)
(1.0 * after.tv_usec - before.tv_usec) / 1000000.0, (1.0 * after.tv_usec - before.tv_usec) / 1000000.0,
ret, ret,
(int)timestamp); (int)timestamp);
#endif
/* tell the other side we're done with the download */ /* tell the other side we're done with the download */
wr = write(fd, "ok", 3); wr = write(fd, "ok", 3);