pop3: Differentiate between success and continuation responses

This commit is contained in:
Steve Holme 2015-11-20 07:01:01 +00:00
parent 6af80afe49
commit 41efdadf09

View File

@ -214,7 +214,7 @@ static const struct Curl_handler Curl_handler_pop3s_proxy = {
/* SASL parameters for the pop3 protocol */ /* SASL parameters for the pop3 protocol */
static const struct SASLproto saslpop3 = { static const struct SASLproto saslpop3 = {
"pop", /* The service name */ "pop", /* The service name */
'+', /* Code received when continuation is expected */ '*', /* Code received when continuation is expected */
'+', /* Code to receive upon authentication success */ '+', /* Code to receive upon authentication success */
255 - 8, /* Maximum initial response length (no max) */ 255 - 8, /* Maximum initial response length (no max) */
pop3_perform_auth, /* Send authentication command */ pop3_perform_auth, /* Send authentication command */
@ -265,14 +265,20 @@ static bool pop3_endofresp(struct connectdata *conn, char *line, size_t len,
return TRUE; return TRUE;
} }
/* Do we have a success or continuation response? */ /* Do we have a success response? */
if((len >= 3 && !memcmp("+OK", line, 3)) || if(len >= 3 && !memcmp("+OK", line, 3)) {
(len >= 1 && !memcmp("+", line, 1))) {
*resp = '+'; *resp = '+';
return TRUE; return TRUE;
} }
/* Do we have a continuation response? */
if(len >= 1 && !memcmp("+", line, 1)) {
*resp = '*';
return TRUE;
}
return FALSE; /* Nothing for us */ return FALSE; /* Nothing for us */
} }