From: Yang Tse Date: Fri, 14 Oct 2011 15:33:05 +0000 (+0200) Subject: sws.c: HTTP and GOPHER test server-side connection closing adjustment X-Git-Tag: curl-7_23_0~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd10c047df694e55abc6950391d6822cecc3000b;p=thirdparty%2Fcurl.git sws.c: HTTP and GOPHER test server-side connection closing adjustment When, for a given test, server is instructed to close connection after server reply we now wait a very small amount of time (50ms) before doing so. This is done to allow client to, at least partially, read server reply before getting an ECONNRESET. The above is required to make test cases 1070, 1200, 1201 and 1202 pass with Cygwin 1.5.X on W2K. GOPHER test server closes connection after _every_ server-reply, as such, at some point it could require a bigger time or using shutdown() before a server-side initiated disconnection. --- diff --git a/tests/server/sws.c b/tests/server/sws.c index 688fb9e12a..b2d6df7a60 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -1440,6 +1440,14 @@ int main(int argc, char *argv[]) break; logmsg("====> Client disconnect"); + + if(!req.open) + /* When instructed to close connection after server-reply we + wait a very small amount of time before doing so. If this + is not done client might get an ECONNRESET before reading + a single byte of server-reply. */ + wait_ms(50); + sclose(msgsock); msgsock = CURL_SOCKET_BAD;