From ce0baa186214cd0d22801a747fa3e204c82bea0c Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Wed, 22 Dec 2004 09:43:39 +0000 Subject: Check for SockWrite() return and bail out on short writes. svn path=/trunk/; revision=4016 --- transact.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'transact.c') diff --git a/transact.c b/transact.c index 247d3e65..f9328df2 100644 --- a/transact.c +++ b/transact.c @@ -1503,7 +1503,10 @@ va_dcl va_end(ap); snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n"); - SockWrite(sock, buf, strlen(buf)); + if (SockWrite(sock, buf, strlen(buf)) < strlen(buf)) { + /* short write, bail out */ + return PS_SOCKET; + } if (outlevel >= O_MONITOR) { -- cgit v1.2.3