mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-24 02:59:07 +08:00
Fail on curl download errors
Fail with an error message instead of trying to handle the text from an HTML error page as an image and fail later for HTTP codes equal or larger than 400. Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
dd1c85dc1e
commit
36f3efdfac
@ -1144,6 +1144,10 @@ bool TessBaseAPI::ProcessPagesInternal(const char *filename, const char *retry_c
|
||||
if (curlcode != CURLE_OK) {
|
||||
return error("curl_easy_setopt");
|
||||
}
|
||||
curlcode = curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);
|
||||
if (curlcode != CURLE_OK) {
|
||||
return error("curl_easy_setopt");
|
||||
}
|
||||
// Follow HTTP, HTTPS, FTP and FTPS redirects.
|
||||
curlcode = curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
if (curlcode != CURLE_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user