Skip to content

Commit

Permalink
feat: better warning for common SSL errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Bereknyei authored and tomberek committed Aug 17, 2024
1 parent b02601c commit aba447b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libstore/filetransfer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct curlFileTransfer : public FileTransfer
bool done = false; // whether either the success or failure function has been called
Callback<FileTransferResult> callback;
CURL * req = 0;
char errbuf[CURL_ERROR_SIZE];
bool active = false; // whether the handle has been added to the multi object
std::string statusMsg;

Expand Down Expand Up @@ -370,6 +371,9 @@ struct curlFileTransfer : public FileTransfer
if (writtenToSink)
curl_easy_setopt(req, CURLOPT_RESUME_FROM_LARGE, writtenToSink);

curl_easy_setopt(req, CURLOPT_ERRORBUFFER, errbuf);
errbuf[0] = 0;

result.data.clear();
result.bodySize = 0;
}
Expand Down Expand Up @@ -484,8 +488,8 @@ struct curlFileTransfer : public FileTransfer
code == CURLE_OK ? "" : fmt(" (curl error: %s)", curl_easy_strerror(code)))
: FileTransferError(err,
std::move(response),
"unable to %s '%s': %s (%d)",
request.verb(), request.uri, curl_easy_strerror(code), code);
"unable to %s '%s': %s (%d) %s",
request.verb(), request.uri, curl_easy_strerror(code), code, errbuf);

/* If this is a transient error, then maybe retry the
download after a while. If we're writing to a
Expand Down

0 comments on commit aba447b

Please sign in to comment.