mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:43:52 +03:00
failf() now only overwrites the error buffer the first time it gets called
for each *_perform(). It makes things a lot easier, as the first one that detects the error get to write the final error reason...
This commit is contained in:
parent
5b948512f9
commit
4163b86cd2
3 changed files with 8 additions and 2 deletions
|
|
@ -140,8 +140,10 @@ void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
|
|||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
if(data->set.errorbuffer)
|
||||
if(data->set.errorbuffer && !data->state.errorbuf) {
|
||||
vsnprintf(data->set.errorbuffer, CURL_ERROR_SIZE, fmt, ap);
|
||||
data->state.errorbuf = TRUE; /* wrote error string */
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue