Changeset 2995


Ignore:
Timestamp:
Sep 9, 2007, 1:52:14 AM (15 years ago)
Author:
charles
Message:

add an `isEncrypted' field to tr_peer_stat, so the GUI can show which connections are encrypted with a lock icon or something

Location:
branches/encryption/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/encryption/libtransmission/peer-io.c

    r2988 r2995  
    374374}
    375375
     376int
     377tr_peerIoIsEncrypted( const tr_peerIo * io )
     378{
     379    return io!=NULL && io->encryptionMode==PEER_ENCRYPTION_RC4;
     380}
     381
    376382void
    377383tr_peerIoWriteBytes( tr_peerIo        * io,
  • branches/encryption/libtransmission/peer-io.h

    r2985 r2995  
    138138                              int              encryptionMode );
    139139
     140int  tr_peerIoIsEncrypted( const tr_peerIo * io );
     141
    140142void tr_peerIoWriteBytes  ( tr_peerIo        * io,
    141143                            struct evbuffer  * outbuf,
  • branches/encryption/libtransmission/peer-mgr.c

    r2989 r2995  
    776776        stat->client           = peer->client;
    777777        stat->progress         = peer->progress;
    778         stat->isConnected      = live;
     778        stat->isConnected      = live ? 1 : 0;
     779        stat->isEncrypted      = tr_peerIoIsEncrypted( peer->io ) ? 1 : 0;
    779780        stat->uploadToRate     = tr_peerIoGetRateToPeer( peer->io );
    780781        stat->downloadFromRate = tr_peerIoGetRateToClient( peer->io );
  • branches/encryption/libtransmission/transmission.h

    r2954 r2995  
    659659    const char * client;
    660660   
    661     int     isConnected;
    662     int     from;
    663     float   progress;
    664     int     port;
     661    unsigned int isConnected   : 1;
     662    unsigned int isEncrypted   : 1;
     663    unsigned int isDownloading : 1;
     664    unsigned int isUploading   : 1;
     665
     666    uint8_t  from;
     667    uint16_t port;
    665668   
    666     int     isDownloading;
    667     int     isUploading;
    668     float   downloadFromRate;
    669     float   uploadToRate;
     669    float progress;
     670    float downloadFromRate;
     671    float uploadToRate;
    670672};
    671673
Note: See TracChangeset for help on using the changeset viewer.