aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
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;