Commit feef7142 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Only check FD_SETSIZE limit on POSIX OSes.

parent 81ced014
...@@ -2435,13 +2435,7 @@ static void httpd_HostThread( httpd_host_t *host ) ...@@ -2435,13 +2435,7 @@ static void httpd_HostThread( httpd_host_t *host )
socklen_t i_sock_size = sizeof( struct sockaddr_storage ); socklen_t i_sock_size = sizeof( struct sockaddr_storage );
struct sockaddr_storage sock; struct sockaddr_storage sock;
// FIXME: use net_Accept()
fd = accept( fd, (struct sockaddr *)&sock, &i_sock_size ); fd = accept( fd, (struct sockaddr *)&sock, &i_sock_size );
if( fd >= FD_SETSIZE )
{
net_Close( fd );
fd = -1;
}
if( fd >= 0 ) if( fd >= 0 )
{ {
...@@ -2455,8 +2449,13 @@ static void httpd_HostThread( httpd_host_t *host ) ...@@ -2455,8 +2449,13 @@ static void httpd_HostThread( httpd_host_t *host )
} }
#else #else
fcntl( fd, F_SETFL, O_NONBLOCK ); fcntl( fd, F_SETFL, O_NONBLOCK );
if( fd >= FD_SETSIZE )
{
net_Close( fd );
fd = -1;
}
else
#endif #endif
if( p_tls != NULL) if( p_tls != NULL)
{ {
switch ( tls_ServerSessionHandshake( p_tls, fd ) ) switch ( tls_ServerSessionHandshake( p_tls, fd ) )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment