pop3/smtp: return *WEIRD_SERVER_REPLY when not understood

This leaves the CURLE_RECV_ERROR error code for explicit failure to
receive network data and allows users to better separate the problems.

Ref #8356
Reported-by: Rianov Viacheslav
Closes #8506
This commit is contained in:
Daniel Stenberg 2022-03-29 14:01:48 +02:00
parent 3a4182d468
commit 5a9d7c4e68
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 14 additions and 14 deletions

View file

@ -293,7 +293,7 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data,
*/
if((ptr + pp->cache_size) > (buf + data->set.buffer_size + 1)) {
failf(data, "cached response data too big to handle");
return CURLE_RECV_ERROR;
return CURLE_WEIRD_SERVER_REPLY;
}
memcpy(ptr, pp->cache, pp->cache_size);
gotbytes = (ssize_t)pp->cache_size;