Changeset 4036
- Timestamp:
- Dec 1, 2007, 11:08:34 PM (14 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/handshake.c
r3846 r4036 969 969 { 970 970 dbgmsg( handshake, "handshakeDone: %s", isOK ? "connected" : "aborting" ); 971 tr_peerIoSetIOFuncs( handshake->io, NULL, NULL, NULL );971 tr_peerIoSetIOFuncs( handshake->io, NULL, NULL, NULL, NULL ); 972 972 973 973 fireDoneFunc( handshake, isOK ); … … 1031 1031 handshake->handle = tr_peerIoGetHandle( io ); 1032 1032 1033 tr_peerIoSetIOFuncs( handshake->io, canRead, gotError, handshake );1033 tr_peerIoSetIOFuncs( handshake->io, canRead, NULL, gotError, handshake ); 1034 1034 1035 1035 if( tr_peerIoIsIncoming( handshake->io ) ) -
trunk/libtransmission/peer-io.c
r3879 r4036 62 62 63 63 tr_can_read_cb canRead; 64 tr_did_write_cb didWrite; 64 65 tr_net_error_cb gotError; 65 66 void * userData; … … 71 72 *** 72 73 **/ 74 75 static void 76 didWriteWrapper( struct bufferevent * e, void * userData ) 77 { 78 tr_peerIo * c = (tr_peerIo *) userData; 79 if( c->didWrite != NULL ) 80 (*c->didWrite)( e, c->userData ); 81 } 73 82 74 83 static void … … 135 144 c->bufev = bufferevent_new( c->socket, 136 145 canReadWrapper, 137 NULL,146 didWriteWrapper, 138 147 gotErrorWrapper, 139 148 c ); … … 193 202 { 194 203 io->canRead = NULL; 204 io->didWrite = NULL; 195 205 io->gotError = NULL; 196 206 tr_runInEventThread( io->handle, io_dtor, io ); … … 242 252 tr_peerIoSetIOFuncs( tr_peerIo * io, 243 253 tr_can_read_cb readcb, 254 tr_did_write_cb writecb, 244 255 tr_net_error_cb errcb, 245 256 void * userData ) 246 257 { 247 258 io->canRead = readcb; 259 io->didWrite = writecb; 248 260 io->gotError = errcb; 249 261 io->userData = userData; … … 273 285 274 286 io->bufev = bufferevent_new( io->socket, 275 canReadWrapper, NULL, gotErrorWrapper, 287 canReadWrapper, 288 didWriteWrapper, 289 gotErrorWrapper, 276 290 io ); 277 291 bufferevent_settimeout( io->bufev, io->timeout, io->timeout ); -
trunk/libtransmission/peer-io.h
r3882 r4036 100 100 typedef enum { READ_MORE, READ_AGAIN, READ_DONE } ReadState; 101 101 typedef ReadState (*tr_can_read_cb)(struct bufferevent*, void* user_data); 102 typedef void (*tr_did_write_cb)(struct bufferevent *, void *); 102 103 typedef void (*tr_net_error_cb)(struct bufferevent *, short what, void *); 103 104 104 105 void tr_peerIoSetIOFuncs( tr_peerIo * io, 105 106 tr_can_read_cb readcb, 107 tr_did_write_cb writecb, 106 108 tr_net_error_cb errcb, 107 109 void * user_data ); -
trunk/libtransmission/peer-msgs.c
r4002 r4036 1411 1411 } 1412 1412 1413 static void 1414 didWrite( struct bufferevent * evin UNUSED, void * vmsgs ) 1415 { 1416 pulse( vmsgs ); 1417 } 1418 1413 1419 static ReadState 1414 1420 canRead( struct bufferevent * evin, void * vmsgs ) … … 1844 1850 1845 1851 tr_peerIoSetTimeoutSecs( m->io, 150 ); /* timeout after N seconds of inactivity */ 1846 tr_peerIoSetIOFuncs( m->io, canRead, gotError, m );1852 tr_peerIoSetIOFuncs( m->io, canRead, didWrite, gotError, m ); 1847 1853 ratePulse( m ); 1848 1854
Note: See TracChangeset
for help on using the changeset viewer.