From b8d1bb3f6e92b5c7edec0a0304c5740da62b8c2d Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Tue, 5 Apr 2011 16:46:13 +0000 Subject: [PATCH] (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. --- libtransmission/peer-io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 43e579955..2b74d3764 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -243,8 +243,8 @@ event_read_cb( int fd, short event UNUSED, void * vio ) 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)", res, what, e, errstr ); + dbgmsg( io, "event_read_cb got an error. res is %d, what is %hd, errno is %d (%s)", + res, what, e, tr_net_strerror( errstr, sizeof( errstr ), e ) ); if( io->gotError != NULL ) 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; if( res == 0 ) 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)", res, what, e, errstr ); + dbgmsg( io, "tr_peerIoTryRead got an error. res is %d, what is %hd, errno is %d (%s)", + res, what, e, tr_net_strerror( errstr, sizeof( errstr ), e ) ); io->gotError( io, what, io->userData ); } }