mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
if addresses come back as IPv4-mapped IPv6 then make it look like IPv4 or else
we'll get queries about the access log. Fix a potential FD leak and add a small delay into the listener thread if accept fails, the usual cause is an FD limit being reached triggering logs to fill up and CPU to max out. svn path=/icecast/trunk/icecast/; revision=13492
This commit is contained in:
parent
916a4a4cd1
commit
adac7ebee4
@ -266,18 +266,24 @@ static connection_t *_accept_connection(void)
|
||||
sock = sock_accept(serversock, ip, MAX_ADDR_LEN);
|
||||
if (sock >= 0)
|
||||
{
|
||||
/* Make any IPv4 mapped IPv6 address look like a normal IPv4 address */
|
||||
if (strncmp (ip, "::ffff:", 7) == 0)
|
||||
memmove (ip, ip+7, strlen (ip+7)+1);
|
||||
|
||||
con = connection_create (sock, serversock, ip);
|
||||
if (con == NULL)
|
||||
free (ip);
|
||||
|
||||
return con;
|
||||
if (con)
|
||||
return con;
|
||||
sock_close (sock);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sock_recoverable(sock_error()))
|
||||
{
|
||||
WARN2("accept() failed with error %d: %s", sock_error(), strerror(sock_error()));
|
||||
thread_sleep (500000);
|
||||
}
|
||||
}
|
||||
|
||||
if (!sock_recoverable(sock_error()))
|
||||
WARN2("accept() failed with error %d: %s", sock_error(), strerror(sock_error()));
|
||||
|
||||
free(ip);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user