for( ptr = res; ptr != NULL; ptr = ptr->ai_next )
{
- int fd = net_Socket( p_this, ptr->ai_family, type ?: ptr->ai_socktype,
- proto ?: ptr->ai_protocol );
+ int fd = net_Socket( p_this, ptr->ai_family,
+ type ? type : ptr->ai_socktype,
+ proto ? proto : ptr->ai_protocol );
if( fd == -1 )
{
msg_Dbg( p_this, "socket error: %m" );
ufd[i].events = POLLIN;
ufd[i].revents = 0;
}
- if (evfd == -1)
- n--; /* avoid EBADF */
- switch (poll (ufd, n, timeout))
+ switch (poll (ufd, n + (evfd != -1), timeout))
{
case -1:
if (net_errno == EINTR)
msg_Err( p_obj, "socks: unsupported authentication method %x",
buffer[0] );
else
- msg_Err( p_obj, "socks: authentification needed" );
+ msg_Err( p_obj, "socks: authentication needed" );
return VLC_EGENERIC;
}
if( buffer[1] != 0x00 )
{
- msg_Err( p_obj, "socks: CONNECT request failed\n" );
+ msg_Err( p_obj, "socks: CONNECT request failed" );
return VLC_EGENERIC;
}