Changeset 926


Ignore:
Timestamp:
Sep 25, 2006, 9:56:52 PM (15 years ago)
Author:
titer
Message:

Remember whether a peer comes from an incoming or outcoming connection

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer.c

    r920 r926  
    4848    int            status;
    4949    int            socket;
     50    char           incoming;
    5051    uint64_t       date;
    5152    uint64_t       keepAlive;
     
    159160    tr_peer_t * peer = peerInit();
    160161
    161     peer->socket = s;
    162     peer->addr   = addr;
    163     peer->port   = port;
    164     peer->status = PEER_STATUS_CONNECTING;
     162    peer->socket   = s;
     163    peer->addr     = addr;
     164    peer->port     = port;
     165    peer->status   = PEER_STATUS_CONNECTING;
     166    peer->incoming = 1;
    165167
    166168    return peer;
     
    484486
    485487/***********************************************************************
     488 * tr_peerIsIncoming
     489 ***********************************************************************
     490 *
     491 **********************************************************************/
     492int tr_peerIsIncoming( tr_peer_t * peer )
     493{
     494    return peer->incoming;
     495}
     496
     497/***********************************************************************
    486498 * tr_peerIsUploading
    487499 ***********************************************************************
  • trunk/libtransmission/transmission.c

    r920 r926  
    577577           
    578578            peers[i].isConnected = tr_peerIsConnected(peer);
     579            peers[i].isIncoming = tr_peerIsIncoming(peer);
    579580            peers[i].isDownloading = tr_peerIsDownloading(peer);
    580581            peers[i].isUploading = tr_peerIsUploading(peer);
  • trunk/libtransmission/transmission.h

    r920 r926  
    373373   
    374374    int     isConnected;
     375    int     isIncoming;
    375376    int     isDownloading;
    376377    int     isUploading;
Note: See TracChangeset for help on using the changeset viewer.