start the retry delay at 10 ms, double it for every failed attempt which makes
it 10 seconds delay after 11 attempts
This commit is contained in:
parent
72bb5854f7
commit
a53ba060c8
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user