mirror of
https://gitlab.xiph.org/xiph/icecast-common.git
synced 2024-06-16 06:15:24 +00:00
Update: Code style
This commit is contained in:
parent
08443ca69e
commit
87ac18cd2c
18
net/sock.c
18
net/sock.c
|
@ -732,29 +732,29 @@ sock_t sock_get_server_socket (int port, const char *sinterface)
|
|||
|
||||
if (getaddrinfo(sinterface, service, &hints, &res))
|
||||
return SOCK_ERROR;
|
||||
ai = res;
|
||||
do
|
||||
{
|
||||
|
||||
for (ai = res; ai; ai = ai->ai_next) {
|
||||
int on = 1;
|
||||
|
||||
sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
||||
if (sock < 0)
|
||||
continue;
|
||||
|
||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, sizeof(on));
|
||||
on = 0;
|
||||
|
||||
#ifdef IPV6_V6ONLY
|
||||
setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof on);
|
||||
on = 0;
|
||||
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof(on));
|
||||
#endif
|
||||
|
||||
if (bind (sock, ai->ai_addr, ai->ai_addrlen) < 0)
|
||||
{
|
||||
if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0){
|
||||
sock_close(sock);
|
||||
continue;
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
return sock;
|
||||
|
||||
} while ((ai = ai->ai_next));
|
||||
}
|
||||
|
||||
freeaddrinfo(res);
|
||||
return SOCK_ERROR;
|
||||
|
|
Loading…
Reference in New Issue
Block a user