diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-21 04:46:40 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-21 04:46:40 +0000 |
commit | 581ac6952f208d5e427c18c028bd83be84200c59 (patch) | |
tree | 5f119b2a9b4f9c31321764ac536592cdb8caf666 | |
parent | 6a2df7a6a363148eebaaf5e9d77ced76899dcd18 (diff) | |
download | fetchmail-581ac6952f208d5e427c18c028bd83be84200c59.tar.gz fetchmail-581ac6952f208d5e427c18c028bd83be84200c59.tar.bz2 fetchmail-581ac6952f208d5e427c18c028bd83be84200c59.zip |
Screem loudly on protocol errors.
svn path=/trunk/; revision=361
-rw-r--r-- | pop3.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -11,6 +11,8 @@ #include "socket.h" #include "fetchmail.h" +#define PROTOCOL_ERROR {fputs("fetchmail: protocol error\n", stderr); return(PS_ERROR);} + static int last; int pop3_ok (socket, argbuf) @@ -95,16 +97,16 @@ char *greeting; switch (queryctl->protocol) { case P_POP3: if ((gen_transact(socket,"USER %s", queryctl->remotename)) != 0) - return(PS_ERROR); + PROTOCOL_ERROR if ((gen_transact(socket, "PASS %s", queryctl->password)) != 0) - return(PS_ERROR); + PROTOCOL_ERROR break; case P_APOP: if ((gen_transact(socket, "APOP %s %s", queryctl->remotename, queryctl->digest)) != 0) - return(PS_ERROR); + PROTOCOL_ERROR break; default: @@ -151,7 +153,7 @@ int *countp, *newp; if (ok == 0) { if (sscanf(buf, "%d", &last) == 0) - return(PS_ERROR); + PROTOCOL_ERROR *newp = (*countp - last); } else @@ -163,7 +165,7 @@ int *countp, *newp; *newp = 0; gen_send(socket, "UIDL"); if ((ok = pop3_ok(socket, buf)) != 0) - return(PS_ERROR); + PROTOCOL_ERROR else { while (SockGets(socket, buf, sizeof(buf)) >= 0) |