aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-07-12 17:03:45 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-07-12 17:03:45 +0000
commita53ba060c8a85e62ada2da42044f0ff181afce2d (patch)
treecf5a8f6f435813428b70e33e364ad561fab545ed
parent72bb5854f7347aa22c0ecb93b3f90ad45bed0460 (diff)
start the retry delay at 10 ms, double it for every failed attempt which makes
it 10 seconds delay after 11 attempts
-rw-r--r--tests/server/sockfilt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 5e13b8ad1..9704eaede 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -399,13 +399,15 @@ static curl_socket_t sockdaemon(curl_socket_t sock,
#endif /* ENABLE_IPV6 */
int flag = 1;
int rc;
- int maxretr = 100;
+ int maxretr = 12;
+ int delay= 10;
rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(void *)&flag, sizeof(flag));
while ((rc < 0) && maxretr) {
maxretr--;
- go_sleep(50);
+ go_sleep(delay);
+ delay *= 2; /* double the sleep for next attempt */
rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
(void *)&flag, sizeof(flag));
}