From 1023508f210cd136992661c01b55b428de86a182 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 7 Nov 2014 17:20:19 +0100 Subject: w32: Remove I/O delays due to our 100ms delay after an EAGAIN. * src/system-w32.c (__assuan_read): Retry using select. Map WSAECONNRESET to EPIPE. (__assuan_write): Retry using select. * src/assuan-buffer.c (readline) [W32]: Return EOF instead of EPIPE. --- src/assuan-buffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/assuan-buffer.c') diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c index f2238e7..04aff5a 100644 --- a/src/assuan-buffer.c +++ b/src/assuan-buffer.c @@ -80,6 +80,15 @@ readline (assuan_context_t ctx, char *buf, size_t buflen, { if (errno == EINTR) continue; +#ifdef HAVE_W32_SYSTEM + if (errno == EPIPE) + { + /* Under Windows we get EPIPE (actually ECONNRESET) + after termination of the client. Assume an EOF. */ + *r_eof = 1; + break; /* allow incomplete lines */ + } +#endif /*HAVE_W32_SYSTEM*/ return -1; /* read error */ } else if (!n) -- cgit v1.2.3