Changeset 3846
- Timestamp:
- Nov 17, 2007, 2:47:47 AM (15 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/handshake.c
r3839 r3846 969 969 { 970 970 dbgmsg( handshake, "handshakeDone: %s", isOK ? "connected" : "aborting" ); 971 tr_peerIoSetIOFuncs( handshake->io, NULL, NULL, NULL , NULL);971 tr_peerIoSetIOFuncs( handshake->io, 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, NULL,gotError, handshake );1033 tr_peerIoSetIOFuncs( handshake->io, canRead, gotError, handshake ); 1034 1034 1035 1035 if( tr_peerIoIsIncoming( handshake->io ) ) -
trunk/libtransmission/peer-io.c
r3845 r3846 61 61 62 62 tr_can_read_cb canRead; 63 tr_did_write_cb didWrite;64 63 tr_net_error_cb gotError; 65 64 void * userData; … … 71 70 *** 72 71 **/ 73 74 static void75 didWriteWrapper( struct bufferevent * e, void * userData )76 {77 tr_peerIo * c = userData;78 if( c->didWrite != NULL )79 (*c->didWrite)( e, c->userData );80 }81 72 82 73 static void … … 142 133 c->bufev = bufferevent_new( c->socket, 143 134 canReadWrapper, 144 didWriteWrapper,135 NULL, 145 136 gotErrorWrapper, 146 137 c ); … … 200 191 { 201 192 io->canRead = NULL; 202 io->didWrite = NULL;203 193 io->gotError = NULL; 204 194 tr_runInEventThread( io->handle, io_dtor, io ); … … 250 240 tr_peerIoSetIOFuncs( tr_peerIo * io, 251 241 tr_can_read_cb readcb, 252 tr_did_write_cb writecb,253 242 tr_net_error_cb errcb, 254 243 void * userData ) 255 244 { 256 245 io->canRead = readcb; 257 io->didWrite = writecb;258 246 io->gotError = errcb; 259 247 io->userData = userData; … … 283 271 284 272 io->bufev = bufferevent_new( io->socket, 285 canReadWrapper, 286 didWriteWrapper, 287 gotErrorWrapper, 273 canReadWrapper, NULL, gotErrorWrapper, 288 274 io ); 289 275 bufferevent_settimeout( io->bufev, IO_TIMEOUT_SECS, IO_TIMEOUT_SECS ); -
trunk/libtransmission/peer-io.h
r3839 r3846 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 *);103 102 typedef void (*tr_net_error_cb)(struct bufferevent *, short what, void *); 104 103 105 104 void tr_peerIoSetIOFuncs( tr_peerIo * io, 106 105 tr_can_read_cb readcb, 107 tr_did_write_cb writecb,108 106 tr_net_error_cb errcb, 109 107 void * user_data ); -
trunk/libtransmission/peer-msgs.c
r3842 r3846 1778 1778 1779 1779 tr_peerIoSetTimeoutSecs( m->io, 150 ); /* timeout after N seconds of inactivity */ 1780 tr_peerIoSetIOFuncs( m->io, canRead, NULL,gotError, m );1780 tr_peerIoSetIOFuncs( m->io, canRead, gotError, m ); 1781 1781 ratePulse( m ); 1782 1782
Note: See TracChangeset
for help on using the changeset viewer.