mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk libT) Don't log two "errors" we expect to see from time-to-time.
EAFNOSUPPORT: On OS X, socket() incorrectly throws EAFNOSUPPORT for certain IP/Port combinations. There is nothing we can do about this. ENETUNREACH: #1606 is evidence that some trackers return IPv6 peers when contacted over IPv4. This code will silently ignore "network unreachable" errors for IPv6 connections.
This commit is contained in:
@@ -459,6 +459,9 @@ tr_fdSocketCreate( int domain, int type )
|
||||
if( gFd->socketCount < getSocketMax( gFd ) )
|
||||
if( ( s = socket( domain, type, 0 ) ) < 0 )
|
||||
{
|
||||
#ifdef SYS_DARWIN
|
||||
if( sockerrno != EAFNOSUPPORT )
|
||||
#endif
|
||||
tr_err( _( "Couldn't create socket: %s" ),
|
||||
tr_strerror( sockerrno ) );
|
||||
s = -sockerrno;
|
||||
|
||||
@@ -402,9 +402,11 @@ tr_netOpenTCP( tr_session * session,
|
||||
&& ( sockerrno != EINPROGRESS ) )
|
||||
{
|
||||
int tmperrno;
|
||||
tr_err( _( "Couldn't connect socket %d to %s, port %d (errno %d - %s)" ),
|
||||
s, tr_ntop_non_ts( addr ), (int)port, sockerrno, tr_strerror( sockerrno ) );
|
||||
tmperrno = sockerrno;
|
||||
if( tmperrno != ENETUNREACH || addr->type == TR_AF_INET )
|
||||
tr_err( _( "Couldn't connect socket %d to %s, port %d (errno %d - %s)" ),
|
||||
s, tr_ntop_non_ts( addr ), (int)port, tmperrno,
|
||||
tr_strerror( tmperrno ) );
|
||||
tr_netClose( s );
|
||||
s = -tmperrno;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user