mirror of
https://github.com/clearlinux/clr-debug-info.git
synced 2026-09-05 21:31:30 +00:00
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.
This commit is contained in:
+7
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user