From c6dedf148f130d78da72f8d75c177d02c1c3fc67 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 8 Sep 2015 11:33:48 +0300 Subject: [PATCH] system/httptool.cpp: add CURLOPT_FAILONERROR to fail on 4xx errors --- src/system/httptool.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index 948895181..8f89db96f 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -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_TIMEOUT, 1800); curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); + curl_easy_setopt(curl, CURLOPT_FAILONERROR, true); #ifdef DEBUG curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); #endif @@ -124,5 +125,5 @@ printf("download code %d\n", res); fclose(headerfile); } - return res==0; + return res==CURLE_OK; }