Compare commits

...
5 Commits
21 ... 23
Author SHA1 Message Date
Patrick McCarty be74f893e6 Bump version for release 2015-10-20 10:24:49 -07:00
Patrick McCarty 7a5e4a9acd Do not log for non-fatal curl errors 2015-10-20 10:17:40 -07:00
Patrick McCarty 07a4c3d305 Bump version for release
This release fixes the handling of a server HTTP 304 response, now
treating it as non-fatal.
2015-10-02 12:15:07 -07:00
Patrick McCarty ab0e59628f Treat HTTP 304 codes as non-fatal
We set the If-Modified-Since header field for each GET request, and if
the condition fails, the server will respond with HTTP 304.

The 304 means the cached debuginfo is up-to-date, not requiring a fresh
download. Since this condition is non-fatal, avoid swapping the download
URLs in this case.
2015-10-02 12:15:02 -07:00
Patrick McCarty af4a3f64f0 Update gitignore 2015-10-02 10:36:39 -07:00
3 changed files with 21 additions and 4 deletions
+2
View File
@@ -20,3 +20,5 @@ install-sh
missing
stamp-h1
*.tar.gz
tags
cscope.*
+1 -1
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.66])
AC_INIT(clr-debug-info, 21, arjan@linux.intel.com)
AC_INIT(clr-debug-info, 23, arjan@linux.intel.com)
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_CC
+18 -3
View File
@@ -122,7 +122,13 @@ static int curl_get_file(const char *url, const char *prefix, time_t timestamp)
fflush(file);
// printf("HTTP return code is %i\n", ret);
if (ret != 200 && ret != 404)
/* HTTP 304 is returned if (a) the cached debuginfo has the same
* timestamp or is newer than that on the server and (b) we haven't
* already added the URL to the hash table. So, the first crash for a
* boot may result in a 304 if the debuginfo had been downloaded in a
* previous boot.
*/
if (ret != 200 && ret != 404 && ret != 304)
urlcounter++;
if (ret == 200) {
@@ -219,8 +225,17 @@ static void *server_thread(void *arg)
// printf("Getting url %s %i:%06i\n", url, before.tv_sec, before.tv_usec);
ret = curl_get_file(url, prefix, timestamp);
if (ret != 200)
printf("Request for %s resulted in error %i\n", url, ret);
switch (ret) {
case 200:
case 300:
case 304:
case 404:
// ignore these error codes
break;
default:
printf("Request for %s resulted in error %i\n", url, ret);
break;
}
gettimeofday(&after, NULL);
if (timedelta(before, after) > 0.6)