summaryrefslogtreecommitdiff
path: root/lib/pop3.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2012-05-28 20:59:10 +0100
committerSteve Holme <steve_holme@hotmail.com>2012-05-28 20:59:10 +0100
commit3fa0fbb816bb03b5d68d80a26323ee8c8609c369 (patch)
treef2750c5ea5fe6dd7b87ce0e7cc331681cab383f1 /lib/pop3.c
parenta9d798c4d54e45d1480e4974eeda244fc0c3300e (diff)
downloadcurl-3fa0fbb816bb03b5d68d80a26323ee8c8609c369.tar.gz
pop3: Changed response code from O and E to + and -
The POP3 protocol doesn't really have the concept of error codes and uses +, +OK and -ERR in response to commands to indicate continue, success and error. The AUTH command is one of those commands that requires multiple pieces of data to be sent to the server where the server will respond with + as part of the handshaking. This meant changing the values before continuing with the next stage of adding authentication support.
Diffstat (limited to 'lib/pop3.c')
-rw-r--r--lib/pop3.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index a9898e218..782da9216 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -223,7 +223,7 @@ static int pop3_endofresp(struct pingpong *pp, int *resp)
(len < 4 || memcmp("-ERR", line, 4)))
return FALSE; /* Nothing for us */
- *resp = line[1]; /* O or E */
+ *resp = line[0]; /* + or - */
if(pop3c->state == POP3_AUTH && len >= 3 && !memcmp(line, "+OK", 3)) {
line += 3;
@@ -355,7 +355,7 @@ static CURLcode pop3_state_servergreet_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */
- if(pop3code != 'O') {
+ if(pop3code != '+') {
failf(data, "Got unexpected pop3-server response");
return CURLE_FTP_WEIRD_SERVER_REPLY;
}
@@ -382,7 +382,7 @@ static CURLcode pop3_state_starttls_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */
- if(pop3code != 'O') {
+ if(pop3code != '+') {
if(data->set.use_ssl != CURLUSESSL_TRY) {
failf(data, "STARTTLS denied. %c", pop3code);
result = CURLE_USE_SSL_FAILED;
@@ -428,7 +428,7 @@ static CURLcode pop3_state_user_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */
- if(pop3code != 'O') {
+ if(pop3code != '+') {
failf(data, "Access denied. %c", pop3code);
result = CURLE_LOGIN_DENIED;
}
@@ -454,7 +454,7 @@ static CURLcode pop3_state_pass_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */
- if(pop3code != 'O') {
+ if(pop3code != '+') {
failf(data, "Access denied. %c", pop3code);
result = CURLE_LOGIN_DENIED;
}
@@ -477,7 +477,7 @@ static CURLcode pop3_state_command_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */
- if('O' != pop3code) {
+ if(pop3code != '+') {
state(conn, POP3_STOP);
return CURLE_RECV_ERROR;
}