diff options
author | Yang Tse <yangsita@gmail.com> | 2009-05-13 19:20:45 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2009-05-13 19:20:45 +0000 |
commit | c31438b2f2ce78ab4cf824f06089772e66b47708 (patch) | |
tree | a4c8b66e9230abe8c77b23ee57ae4ea92ba0f023 /tests/server | |
parent | 843f73ecaa4a83ef75421efda5bae29a1da07cb7 (diff) |
log each setsockopt/SO_REUSEADDR failure
Diffstat (limited to 'tests/server')
-rw-r--r-- | tests/server/sockfilt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 97e2e4ce0..2abdaa0df 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -688,13 +688,16 @@ static curl_socket_t sockdaemon(curl_socket_t sock, int delay= 20; int attempt = 0; int error = 0; + curl_socklen_t optlen; do { attempt++; + optlen = sizeof(flag); rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag)); + (void *)&flag, optlen); if(rc) { error = SOCKERRNO; + logmsg("setsockopt/SO_REUSEADDR failed: (%d) %s", error, strerror(error)); if(maxretr) { rc = wait_ms(delay); if(rc) { |