mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
system/httptool.cpp: add CURLOPT_FAILONERROR to fail on 4xx errors
Origin commit data
------------------
Commit: c6dedf148f
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2015-09-08 (Tue, 08 Sep 2015)
This commit is contained in:
@@ -91,6 +91,7 @@ printf("url is %s\n", URL.c_str());
|
|||||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);
|
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1);
|
||||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1800);
|
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1800);
|
||||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
#endif
|
#endif
|
||||||
@@ -124,5 +125,5 @@ printf("download code %d\n", res);
|
|||||||
fclose(headerfile);
|
fclose(headerfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res==0;
|
return res==CURLE_OK;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user