aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-10-31 07:33:44 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-10-31 07:33:44 +0000
commitd3be49ac9e5a338f15056b7c5b14aa905bb1f474 (patch)
tree530b308cfb3a62560ccfb00e75f1cee849549c8b /socket.c
parent34548a4d7bf2368ef5dcfe69ec10c1ea5305af5e (diff)
downloadfetchmail-d3be49ac9e5a338f15056b7c5b14aa905bb1f474.tar.gz
fetchmail-d3be49ac9e5a338f15056b7c5b14aa905bb1f474.tar.bz2
fetchmail-d3be49ac9e5a338f15056b7c5b14aa905bb1f474.zip
STEP 7: Take mboxfd out of the SMTP logic path entirely.
svn path=/trunk/; revision=450
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/socket.c b/socket.c
index f5b73b98..6ee4d961 100644
--- a/socket.c
+++ b/socket.c
@@ -78,11 +78,7 @@ int SockPuts(buf, sockfp)
char *buf;
FILE *sockfp;
{
- int rc;
-
- if ((rc = SockWrite(fileno(sockfp), buf, strlen(buf))) != 0)
- return rc;
- return SockWrite(fileno(sockfp), "\r\n", 2);
+ return(SockWrite(fileno(sockfp), buf, strlen(buf)));
}
int SockWrite(socket,buf,len)
@@ -90,7 +86,7 @@ int socket;
char *buf;
int len;
{
- int n;
+ int n, rdlen = 0;
while (len)
{
@@ -98,9 +94,10 @@ int len;
if (n <= 0)
return -1;
len -= n;
- buf += n;
+ rdlen += n;
+ buf += n;
}
- return 0;
+ return rdlen;
}
static int sbuflen = 0;