From: Marc Hoersken Date: Sat, 6 Apr 2013 17:05:16 +0000 (+0200) Subject: sockfilt.c: Reduce CPU load while running under a Windows PIPE X-Git-Tag: curl-7_30_0~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ba0f1373c6d3fdbc268a02d1eefb06ba6fa336b;p=thirdparty%2Fcurl.git sockfilt.c: Reduce CPU load while running under a Windows PIPE --- diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 5c7277dfb3..1a1eeb3c2e 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -643,8 +643,11 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds, /* check if there is no data from PIPE input */ if(!PeekNamedPipe(handle, NULL, 0, NULL, &avail, NULL)) avail = 0; - if(!avail) + if(!avail) { FD_CLR(sock, readfds); + /* reduce CPU load */ + Sleep(10); + } } /* check if there is no data from keyboard input */ else if (!_kbhit()) { /* check if there are INPUT_RECORDs in the input buffer */