- Timestamp:
- Aug 18, 2006, 8:46:19 AM (16 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/net.c
r261 r791 404 404 #endif 405 405 } 406 407 void tr_netNtop( const struct in_addr * addr, char * buf, int len ) 408 { 409 const uint8_t * cast; 410 411 cast = (const uint8_t *)addr; 412 snprintf( buf, len, "%hhu.%hhu.%hhu.%hhu", 413 cast[0], cast[1], cast[2], cast[3] ); 414 } -
trunk/libtransmission/net.h
r261 r791 53 53 int tr_netRecv ( int s, uint8_t * buf, int size ); 54 54 55 void tr_netNtop( const struct in_addr * addr, char * buf, int len ); -
trunk/libtransmission/transmission.c
r788 r791 411 411 { 412 412 tr_stat_t * s; 413 tr_peer_t * peer; 413 414 tr_info_t * inf = &tor->info; 414 415 int i; … … 436 437 s->peersDownloading = 0; 437 438 438 tr_peer_t * peer;439 439 for( i = 0; i < tor->peerCount; i++ ) 440 440 { … … 495 495 tr_peer_stat_t * tr_torrentPeers( tr_torrent_t * tor, int * peerCount ) 496 496 { 497 tr_peer_stat_t * peers; 498 497 499 tr_lockLock( &tor->lock ); 498 500 499 501 *peerCount = tor->peerCount; 500 502 501 tr_peer_stat_t *peers = (tr_peer_stat_t *) calloc( tor->peerCount, sizeof( tr_peer_stat_t ) );503 peers = (tr_peer_stat_t *) calloc( tor->peerCount, sizeof( tr_peer_stat_t ) ); 502 504 if (peers != NULL) 503 505 { … … 512 514 if( NULL != addr ) 513 515 { 514 inet_ntop( AF_INET,addr, peers[i].addr,516 tr_netNtop( addr, peers[i].addr, 515 517 sizeof( peers[i].addr ) ); 516 518 } … … 531 533 void tr_torrentPeersFree( tr_peer_stat_t * peers, int peerCount ) 532 534 { 535 int i; 536 533 537 if (peers == NULL) 534 538 return; 535 539 536 int i;537 540 for (i = 0; i < peerCount; i++) 538 541 free( peers[i].client );
Note: See TracChangeset
for help on using the changeset viewer.