Changeset 7236


Ignore:
Timestamp:
Dec 2, 2008, 7:06:08 PM (12 years ago)
Author:
charles
Message:

(libT) fix r7234 bug reported by John_Clay

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r7234 r7236  
    973973                  void * vt )
    974974{
    975     tr_peer *            peer = vpeer; /* may be NULL if peer is a webseed */
    976     Torrent *             t = (Torrent *) vt;
     975    tr_peer             * peer = vpeer; /* may be NULL if peer is a webseed */
     976    Torrent             * t = vt;
    977977    const tr_peer_event * e = vevent;
    978978
     
    12771277                peer->port = port;
    12781278                peer->io = io;
    1279                 peer->msgs = tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );
     1279                tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );
    12801280                tr_peerIoSetBandwidth( io, peer->bandwidth );
    12811281
  • trunk/libtransmission/peer-msgs.c

    r7235 r7236  
    520520         tr_peer_event * e )
    521521{
     522    assert( msgs->info );
     523    assert( msgs->info->msgs == msgs );
     524
    522525    tr_publisherPublish( msgs->publisher, msgs->info, e );
    523526}
     
    21292132tr_peermsgs*
    21302133tr_peerMsgsNew( struct tr_torrent * torrent,
    2131                 struct tr_peer *    info,
     2134                struct tr_peer *    peer,
    21322135                tr_delivery_func    func,
    21332136                void *              userData,
     
    21362139    tr_peermsgs * m;
    21372140
    2138     assert( info );
    2139     assert( info->io );
     2141    assert( peer );
     2142    assert( peer->io );
    21402143
    21412144    m = tr_new0( tr_peermsgs, 1 );
    21422145    m->publisher = tr_publisherNew( );
    2143     m->info = info;
     2146    m->info = peer;
    21442147    m->session = torrent->session;
    21452148    m->torrent = torrent;
    2146     m->io = info->io;
     2149    m->io = peer->io;
    21472150    m->info->clientIsChoked = 1;
    21482151    m->info->peerIsChoked = 1;
     
    21602163    m->clientAskedFor = REQUEST_LIST_INIT;
    21612164    m->clientWillAskFor = REQUEST_LIST_INIT;
     2165    peer->msgs = m;
     2166
    21622167    *setme = tr_publisherSubscribe( m->publisher, func, userData );
    21632168
     
    21672172    tellPeerWhatWeHave( m );
    21682173
    2169     tr_peerIoSetTimeoutSecs( m->io, 150 ); /* timeout after N seconds of
    2170                                              inactivity */
     2174    tr_peerIoSetTimeoutSecs( m->io, 150 ); /* timeout after N seconds of inactivity */
    21712175    tr_peerIoSetIOFuncs( m->io, canRead, didWrite, gotError, m );
    21722176    ratePulse( m );
Note: See TracChangeset for help on using the changeset viewer.