(trunk libT) when processing errors in peer-io.c's event_read_cb() and tr_peerIoTryRead() functions, don't call tr_net_strerror() unless logging is turned on s.t. the string will be used.
This commit is contained in:
parent
3ba9796f4b
commit
b8d1bb3f6e
|
@ -243,8 +243,8 @@ event_read_cb( int fd, short event UNUSED, void * vio )
|
||||||
what |= BEV_EVENT_ERROR;
|
what |= BEV_EVENT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr_net_strerror( errstr, sizeof( errstr ), e );
|
dbgmsg( io, "event_read_cb got an error. res is %d, what is %hd, errno is %d (%s)",
|
||||||
dbgmsg( io, "event_read_cb got an error. res is %d, what is %hd, errno is %d (%s)", res, what, e, errstr );
|
res, what, e, tr_net_strerror( errstr, sizeof( errstr ), e ) );
|
||||||
|
|
||||||
if( io->gotError != NULL )
|
if( io->gotError != NULL )
|
||||||
io->gotError( io, what, io->userData );
|
io->gotError( io, what, io->userData );
|
||||||
|
@ -1166,8 +1166,8 @@ tr_peerIoTryRead( tr_peerIo * io, size_t howmuch )
|
||||||
short what = BEV_EVENT_READING | BEV_EVENT_ERROR;
|
short what = BEV_EVENT_READING | BEV_EVENT_ERROR;
|
||||||
if( res == 0 )
|
if( res == 0 )
|
||||||
what |= BEV_EVENT_EOF;
|
what |= BEV_EVENT_EOF;
|
||||||
tr_net_strerror( errstr, sizeof( errstr ), e );
|
dbgmsg( io, "tr_peerIoTryRead got an error. res is %d, what is %hd, errno is %d (%s)",
|
||||||
dbgmsg( io, "tr_peerIoTryRead got an error. res is %d, what is %hd, errno is %d (%s)", res, what, e, errstr );
|
res, what, e, tr_net_strerror( errstr, sizeof( errstr ), e ) );
|
||||||
io->gotError( io, what, io->userData );
|
io->gotError( io, what, io->userData );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue