aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-24 00:06:47 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-24 00:06:47 +0000
commitd92b8233c987c8f48c56500bc4d7bd84c82ded63 (patch)
treedbdd7d0010d435946024e4e443de15b85c0316ad /pop3.c
parent7f0f666a6dab4ce685d25346b5f17857076e4c2f (diff)
downloadfetchmail-d92b8233c987c8f48c56500bc4d7bd84c82ded63.tar.gz
fetchmail-d92b8233c987c8f48c56500bc4d7bd84c82ded63.tar.bz2
fetchmail-d92b8233c987c8f48c56500bc4d7bd84c82ded63.zip
Introduce gen_recv.
svn path=/trunk/; revision=814
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/pop3.c b/pop3.c
index 01b92b84..07fc22de 100644
--- a/pop3.c
+++ b/pop3.c
@@ -32,14 +32,8 @@ int pop3_ok (FILE *sockfp, char *argbuf)
char buf [POPBUFSIZE+1];
char *bufp;
- if (SockGets(buf, sizeof(buf), sockfp)) {
- if (buf[strlen(buf)-1] == '\n')
- buf[strlen(buf)-1] = '\0';
- if (buf[strlen(buf)-1] == '\r')
- buf[strlen(buf)-1] = '\r';
- if (outlevel == O_VERBOSE)
- error(0, 0, "POP3< %s", buf);
-
+ if ((ok = gen_recv(sockfp, buf, sizeof(buf))) == 0)
+ {
bufp = buf;
if (*bufp == '+' || *bufp == '-')
bufp++;
@@ -60,8 +54,6 @@ int pop3_ok (FILE *sockfp, char *argbuf)
if (argbuf != NULL)
strcpy(argbuf,bufp);
}
- else
- ok = PS_SOCKET;
return(ok);
}
@@ -179,14 +171,8 @@ static int pop3_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
int num;
*newp = 0;
- while (SockGets(buf, sizeof(buf), sockfp))
+ while (!gen_recv(sockfp, buf, sizeof(buf)))
{
- if (buf[strlen(buf)-1] == '\n')
- buf[strlen(buf)-1] = '\0';
- if (buf[strlen(buf)-1] == '\r')
- buf[strlen(buf)-1] = '\r';
- if (outlevel == O_VERBOSE)
- error(0, 0, "POP3< %s", buf);
if (buf[0] == '.')
break;
else if (sscanf(buf, "%d %s", &num, id) == 2)
@@ -216,16 +202,10 @@ static int pop3_getsizes(FILE *sockfp, int count, int *sizes)
{
char buf [POPBUFSIZE+1];
- while (SockGets(buf, sizeof(buf), sockfp))
+ while (!gen_recv(sockfp, buf, sizeof(buf)))
{
int num, size;
- if (buf[strlen(buf)-1] == '\n')
- buf[strlen(buf)-1] = '\0';
- if (buf[strlen(buf)-1] == '\r')
- buf[strlen(buf)-1] = '\r';
- if (outlevel == O_VERBOSE)
- error(0, 0, "POP3< %s", buf);
if (buf[0] == '.')
break;
else if (sscanf(buf, "%d %d", &num, &size) == 2)