~ubuntu-branches/ubuntu/hardy/transmission/hardy-updates

« back to all changes in this revision

Viewing changes to libtransmission/peer-io.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-01-14 20:27:42 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20080114202742-38opwgiy41dx0187
Tags: upstream-1.01
ImportĀ upstreamĀ versionĀ 1.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * This exemption does not extend to derived works not owned by
8
8
 * the Transmission project.
9
9
 *
10
 
 * $Id: peer-io.c 4404 2008-01-01 17:20:20Z charles $
 
10
 * $Id: peer-io.c 4610 2008-01-11 02:43:47Z charles $
11
11
 */
12
12
 
13
13
#include <assert.h>
53
53
    int timeout;
54
54
    struct bufferevent * bufev;
55
55
    uint8_t peerId[20];
 
56
    time_t timeCreated;
56
57
 
57
58
    tr_extensions extensions;
58
59
 
141
142
    c->socket = socket;
142
143
    c->isIncoming = isIncoming ? 1 : 0;
143
144
    c->timeout = IO_TIMEOUT_SECS;
 
145
    c->timeCreated = time( NULL );
144
146
    c->bufev = bufferevent_new( c->socket,
145
147
                                canReadWrapper,
146
148
                                didWriteWrapper,
577
579
    tr_peerIoReadBytes( io, inbuf, tmp, byteCount );
578
580
    tr_free( tmp );
579
581
}
 
582
 
 
583
int
 
584
tr_peerIoGetAge( const tr_peerIo * io )
 
585
{
 
586
    return time( NULL ) - io->timeCreated;
 
587
}