1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

fix byte ordering of the port in tr_peerIoAddrStr()

This commit is contained in:
Charles Kerr 2008-01-17 00:08:40 +00:00
parent 88053029bb
commit 6c6228770c
2 changed files with 3 additions and 2 deletions

View file

@ -242,7 +242,7 @@ const char*
tr_peerIoAddrStr( const struct in_addr * addr, uint16_t port ) tr_peerIoAddrStr( const struct in_addr * addr, uint16_t port )
{ {
static char buf[512]; static char buf[512];
snprintf( buf, sizeof(buf), "%s:%u", inet_ntoa( *addr ), (unsigned int)port ); snprintf( buf, sizeof(buf), "%s:%u", inet_ntoa( *addr ), ntohs( port ) );
return buf; return buf;
} }

View file

@ -254,7 +254,8 @@ publishNewPeers( tr_tracker * t, int count, uint8_t * peers )
event.peerCount = count; event.peerCount = count;
event.peerCompact = peers; event.peerCompact = peers;
tr_inf( "Torrent \"%s\" got %d new peers", t->name, count ); tr_inf( "Torrent \"%s\" got %d new peers", t->name, count );
tr_publisherPublish( t->publisher, t, &event ); if( count )
tr_publisherPublish( t->publisher, t, &event );
} }
/*** /***