# # patch "netxx_pipe.cc" # from [d82cc501c0c1cfb936da3161e294c348ba66e568] # to [13382004adce903aefb4b95c8f4a159e99391cdc] # ======================================================================== --- netxx_pipe.cc d82cc501c0c1cfb936da3161e294c348ba66e568 +++ netxx_pipe.cc 13382004adce903aefb4b95c8f4a159e99391cdc @@ -215,8 +215,13 @@ FAIL_IF( ReadFile,(h_read,pipe->readbuf,1,&bytes_read,&pipe->overlap),==0); if (!bytes_read) { - FAIL_IF( WaitForSingleObject,(pipe->overlap.hEvent,timeout.get_sec()),==WAIT_FAILED); + int seconds=timeout.get_sec(); + // WaitForSingleObject is inaccurate + if (!seconds && timeout.get_usec()) seconds=1; + L(F("WaitForSingleObject(,%d)\n") % seconds); + FAIL_IF( WaitForSingleObject,(pipe->overlap.hEvent,seconds),==WAIT_FAILED); FAIL_IF( GetOverlappedResult,(h_read,&pipe->overlap,&bytes_read,FALSE),==0); + L(F("GetOverlappedResult(,,%d,)\n") % bytes_read); if (!bytes_read) { FAIL_IF( CancelIo,(h_read),==0); @@ -225,7 +230,9 @@ } I(bytes_read==1); pipe->bytes_available=bytes_read; + L(F("ReadFile\n")); FAIL_IF( ReadFile,(h_read,pipe->readbuf+1,sizeof pipe->readbuf-1,&bytes_read,&pipe->overlap),==0); + L(F("CancelIo\n")); FAIL_IF( CancelIo,(h_read),==0); if (!bytes_read) {