From 581ac6952f208d5e427c18c028bd83be84200c59 Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond" <esr@thyrsus.com>
Date: Mon, 21 Oct 1996 04:46:40 +0000
Subject: Screem loudly on protocol errors.

svn path=/trunk/; revision=361
---
 pop3.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/pop3.c b/pop3.c
index e38e9c5d..491bf912 100644
--- a/pop3.c
+++ b/pop3.c
@@ -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)
-- 
cgit v1.2.3