From d623b49f37e8eb502e5ecc2c10c065a7b1bf0ee2 Mon Sep 17 00:00:00 2001 From: robs Date: Tue, 6 Mar 2001 12:57:33 +0000 Subject: [PATCH] Reset LastError when we're doing "named pipe discovery" --- fcgi_buf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fcgi_buf.c b/fcgi_buf.c index 971580e..33cc072 100644 --- a/fcgi_buf.c +++ b/fcgi_buf.c @@ -1,5 +1,5 @@ /* - * $Id: fcgi_buf.c,v 1.9 2001/02/19 03:18:56 robs Exp $ + * $Id: fcgi_buf.c,v 1.10 2001/03/06 12:57:33 robs Exp $ */ #include "fcgi.h" @@ -59,6 +59,11 @@ static int fd_read(SOCKET fd, char *buf, int len) bytes_read = 0; } else if (rv == ERROR_INVALID_PARAMETER) { + + SetLastError(ERROR_SUCCESS); + + // Then it must be a real socket + bytes_read = recv(fd, buf, len, 0); if (bytes_read == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -236,6 +241,8 @@ static int fd_write(SOCKET fd, char * buf, int len) if (rv == ERROR_INVALID_PARAMETER) { + SetLastError(ERROR_SUCCESS); + // Then it must be a real socket.. bytes_sent = send(fd, buf, len, 0); if (bytes_sent == SOCKET_ERROR) { -- 2.11.4.GIT