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

Add peer's port to tr_peer_stat_t.

This commit is contained in:
Josh Elsasser 2006-12-18 03:45:22 +00:00
parent ae94e3c275
commit 343e51abbe
4 changed files with 19 additions and 6 deletions

View file

@ -537,7 +537,7 @@ int tr_peerIsDownloading( tr_peer_t * peer )
}
/***********************************************************************
* tr_peerIsDownloading
* tr_peerProgress
***********************************************************************
*
**********************************************************************/
@ -546,6 +546,16 @@ float tr_peerProgress( tr_peer_t * peer )
return peer->progress;
}
/***********************************************************************
* tr_peerPort
***********************************************************************
* Returns peer's listening port in host byte order
**********************************************************************/
int tr_peerPort( tr_peer_t * peer )
{
return ntohs( peer->port );
}
/***********************************************************************
* tr_peerBitfield
***********************************************************************

View file

@ -44,6 +44,7 @@ int tr_peerIsIncoming ( tr_peer_t * );
int tr_peerIsUploading ( tr_peer_t * );
int tr_peerIsDownloading ( tr_peer_t * );
float tr_peerProgress ( tr_peer_t * );
int tr_peerPort ( tr_peer_t * );
uint8_t * tr_peerBitfield ( tr_peer_t * );
float tr_peerDownloadRate ( tr_peer_t * );
int tr_peerIsUnchoked ( tr_peer_t * );

View file

@ -584,11 +584,12 @@ tr_peer_stat_t * tr_torrentPeers( tr_torrent_t * tor, int * peerCount )
peers[i].client = tr_clientForId(tr_peerId(peer));
peers[i].isConnected = tr_peerIsConnected(peer);
peers[i].isIncoming = tr_peerIsIncoming(peer);
peers[i].isDownloading = tr_peerIsDownloading(peer);
peers[i].isUploading = tr_peerIsUploading(peer);
peers[i].progress = tr_peerProgress(peer);
peers[i].isConnected = tr_peerIsConnected( peer );
peers[i].isIncoming = tr_peerIsIncoming( peer );
peers[i].isDownloading = tr_peerIsDownloading( peer );
peers[i].isUploading = tr_peerIsUploading( peer );
peers[i].progress = tr_peerProgress( peer );
peers[i].port = tr_peerPort( peer );
}
}

View file

@ -396,6 +396,7 @@ struct tr_peer_stat_s
int isDownloading;
int isUploading;
float progress;
int port;
};
struct tr_msg_list_s