mirror of
https://github.com/curl/curl.git
synced 2025-04-12 16:20:35 +08:00
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:
parent
3a4182d468
commit
5a9d7c4e68
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -34,7 +34,7 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -l -u user:secret
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
56
|
||||
8
|
||||
</errorcode>
|
||||
<protocol>
|
||||
CAPA
|
||||
|
@ -34,7 +34,7 @@ pop3://%HOSTIP:%POP3PORT/%TESTNUMBER -u user:secret
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
<errorcode>
|
||||
56
|
||||
8
|
||||
</errorcode>
|
||||
<protocol>
|
||||
CAPA
|
||||
|
@ -31,9 +31,9 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt recipient
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 56 - CURLE_RECV_ERROR
|
||||
# 8 - CURLE_WEIRD_SERVER_REPLY
|
||||
<errorcode>
|
||||
56
|
||||
8
|
||||
</errorcode>
|
||||
<protocol>
|
||||
EHLO %TESTNUMBER
|
||||
|
@ -38,9 +38,9 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Användaren
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 56 - CURLE_RECV_ERROR
|
||||
# 8 - CURLE_WEIRD_SERVER_REPLY
|
||||
<errorcode>
|
||||
56
|
||||
8
|
||||
</errorcode>
|
||||
<protocol>
|
||||
EHLO %TESTNUMBER
|
||||
|
@ -38,9 +38,9 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt Användaren@example.com
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 56 - CURLE_RECV_ERROR
|
||||
# 8 - CURLE_WEIRD_SERVER_REPLY
|
||||
<errorcode>
|
||||
56
|
||||
8
|
||||
</errorcode>
|
||||
<protocol>
|
||||
EHLO %TESTNUMBER
|
||||
|
@ -39,9 +39,9 @@ smtp://%HOSTIP:%SMTPPORT/%TESTNUMBER --mail-rcpt user@åäö.se
|
||||
#
|
||||
# Verify data after the test has been "shot"
|
||||
<verify>
|
||||
# 56 - CURLE_RECV_ERROR
|
||||
# 8 - CURLE_WEIRD_SERVER_REPLY
|
||||
<errorcode>
|
||||
56
|
||||
8
|
||||
</errorcode>
|
||||
<protocol>
|
||||
EHLO %TESTNUMBER
|
||||
|
Loading…
x
Reference in New Issue
Block a user