diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-03-29 14:01:48 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-03-29 14:01:53 +0200 |
commit | 5a9d7c4e68fccd4f67c95cea76a1c3467fbe71d2 (patch) | |
tree | 7adfa34b1abd0ea5a8bb998dd72db3664f511acb /lib | |
parent | 3a4182d468092c0e759002eec9f1764ce07f13da (diff) | |
download | curl-5a9d7c4e68fccd4f67c95cea76a1c3467fbe71d2.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pingpong.c | 2 | ||||
-rw-r--r-- | lib/pop3.c | 2 | ||||
-rw-r--r-- | lib/smtp.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/pingpong.c b/lib/pingpong.c index 1453bf299..e08c1d866 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -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; diff --git a/lib/pop3.c b/lib/pop3.c index 065bdbaf5..3e0d5a4a0 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -924,7 +924,7 @@ static CURLcode pop3_state_command_resp(struct Curl_easy *data, if(pop3code != '+') { state(data, POP3_STOP); - return CURLE_RECV_ERROR; + return CURLE_WEIRD_SERVER_REPLY; } /* This 'OK' line ends with a CR LF pair which is the two first bytes of the diff --git a/lib/smtp.c b/lib/smtp.c index 28aa44a49..3e04154ba 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1037,7 +1037,7 @@ static CURLcode smtp_state_command_resp(struct Curl_easy *data, int smtpcode, if((smtp->rcpt && smtpcode/100 != 2 && smtpcode != 553 && smtpcode != 1) || (!smtp->rcpt && smtpcode/100 != 2 && smtpcode != 1)) { failf(data, "Command failed: %d", smtpcode); - result = CURLE_RECV_ERROR; + result = CURLE_WEIRD_SERVER_REPLY; } else { /* Temporarily add the LF character back and send as body to the client */ @@ -1182,7 +1182,7 @@ static CURLcode smtp_state_postdata_resp(struct Curl_easy *data, (void)instate; /* no use for this yet */ if(smtpcode != 250) - result = CURLE_RECV_ERROR; + result = CURLE_WEIRD_SERVER_REPLY; /* End of DONE phase */ state(data, SMTP_STOP); |