our gateway to curl:
static size_t
gotdata(void *data, size_t size, size_t nmemb, void *cglobal)
{
AsyncIO *IO = (AsyncIO*) cglobal;
SetEVState(IO, eCurlGotData);
if (IO->HttpReq.ReplyData == NULL)
{
IO->HttpReq.ReplyData = NewStrBufPlain(NULL, SIZ);
}
IO->Now = ev_now(event_base);
return CurlFillStrBuf_callback(data,
size,
nmemb,
IO->HttpReq.ReplyData);
}
size_t CurlFillStrBuf_callback(void *ptr, size_t size, size_t nmemb, void *stream)
{
StrBuf *Target;
Target = stream;
if (ptr == NULL)
return 0;
StrBufAppendBufPlain(Target, ptr, size * nmemb, 0);
return size * nmemb;
}
so... its gotta be cURL that gives us uninitialized data in case of errors...
only possible solution is to skip the reply buffer from the error message, which may contain usefull informations in other cases...