(trunk libT) when processing an error in tr_peerIoTryWrite(), don't call tr_net_strerror() unless logging is turned on s.t. the string will be used.

This commit is contained in:
Jordan Lee 2011-04-05 16:34:49 +00:00
parent fb2ffbc542
commit 3ba9796f4b
1 changed files with 2 additions and 2 deletions

View File

@ -1210,8 +1210,8 @@ tr_peerIoTryWrite( tr_peerIo * io, size_t howmuch )
char errstr[512];
const short what = BEV_EVENT_WRITING | BEV_EVENT_ERROR;
tr_net_strerror( errstr, sizeof( errstr ), e );
dbgmsg( io, "tr_peerIoTryWrite got an error. res is %d, what is %hd, errno is %d (%s)", n, what, e, errstr );
dbgmsg( io, "tr_peerIoTryWrite got an error. res is %d, what is %hd, errno is %d (%s)",
n, what, e, tr_net_strerror( errstr, sizeof( errstr ), e ) );
if( io->gotError != NULL )
io->gotError( io, what, io->userData );