diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-05-13 23:42:04 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-05-13 23:42:04 +0000 |
commit | 451d98c467f141e7802b91d26869b6e38ee868fc (patch) | |
tree | 7db5f650940300bb81cd23ab9d41a312ece63e68 /pop2.c | |
parent | 2cbdef3efbe733325aea934ed3ffab9e9ba6175e (diff) | |
download | fetchmail-451d98c467f141e7802b91d26869b6e38ee868fc.tar.gz fetchmail-451d98c467f141e7802b91d26869b6e38ee868fc.tar.bz2 fetchmail-451d98c467f141e7802b91d26869b6e38ee868fc.zip |
Change type of socket descriptors from FILE * to int. Change SockGets
to SockRead a la read(2). This is all part of an attempt to deal with
embedded NULs in IMAP messages.
svn path=/trunk/; revision=992
Diffstat (limited to 'pop2.c')
-rw-r--r-- | pop2.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -16,7 +16,7 @@ static int pound_arg, equal_arg; -int pop2_ok (FILE *sockfp, char *argbuf) +int pop2_ok (int sock, char *argbuf) /* parse POP2 command response */ { int ok; @@ -24,7 +24,7 @@ int pop2_ok (FILE *sockfp, char *argbuf) pound_arg = equal_arg = -1; - if ((ok = gen_recv(sockfp, buf, sizeof(buf))) == 0) + if ((ok = gen_recv(sock, buf, sizeof(buf))) == 0) { if (buf[0] == '+') ok = 0; @@ -50,15 +50,15 @@ int pop2_ok (FILE *sockfp, char *argbuf) return(ok); } -int pop2_getauth(FILE *sockfp, struct query *ctl, char *buf) +int pop2_getauth(int sock, struct query *ctl, char *buf) /* apply for connection authorization */ { - return(gen_transact(sockfp, + return(gen_transact(sock, "HELO %s %s", ctl->remotename, ctl->password)); } -static int pop2_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp) +static int pop2_getrange(int sock, struct query *ctl, int*countp, int*newp) /* get range of messages to be fetched */ { /* @@ -71,7 +71,7 @@ static int pop2_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp) /* maybe the user wanted a non-default folder */ if (ctl->mailbox) { - int ok = gen_transact(sockfp, "FOLD %s", ctl->mailbox); + int ok = gen_transact(sock, "FOLD %s", ctl->mailbox); if (ok != 0) return(ok); @@ -85,26 +85,26 @@ static int pop2_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp) return(0); } -static int pop2_fetch(FILE *sockfp, struct query *ctl, int number, int *lenp) +static int pop2_fetch(int sock, struct query *ctl, int number, int *lenp) /* request nth message */ { int ok; *lenp = 0; - ok = gen_transact(sockfp, "READ %d", number); + ok = gen_transact(sock, "READ %d", number); if (ok) return(0); *lenp = equal_arg; - gen_send(sockfp, "RETR"); + gen_send(sock, "RETR"); return(ok); } -static int pop2_trail(FILE *sockfp, struct query *ctl, int number) +static int pop2_trail(int sock, struct query *ctl, int number) /* send acknowledgement for message data */ { - return(gen_transact(sockfp, ctl->keep ? "ACKS" : "ACKD")); + return(gen_transact(sock, ctl->keep ? "ACKS" : "ACKD")); } const static struct method pop2 = |