Ignore:
Timestamp:
Oct 29, 2009, 4:10:03 PM (13 years ago)
Author:
charles
Message:

(trunk libT) #2508 atom->port never updated

File:
1 edited

Legend:

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

    r9383 r9434  
    413413**/
    414414
    415 static const tr_peer_event blankEvent = { 0, 0, 0, 0, 0.0f, 0, 0, 0 };
     415static const tr_peer_event blankEvent = { 0, 0, 0, 0, 0.0f, 0, 0, 0, 0 };
    416416
    417417static void
     
    489489    e.eventType = TR_PEER_CLIENT_GOT_SUGGEST;
    490490    e.pieceIndex = pieceIndex;
     491    publish( msgs, &e );
     492}
     493
     494static void
     495fireClientGotPort( tr_peermsgs * msgs, tr_port port )
     496{
     497    tr_peer_event e = blankEvent;
     498    e.eventType = TR_PEER_CLIENT_GOT_PORT;
     499    e.port = port;
    491500    publish( msgs, &e );
    492501}
     
    10601069    /* get peer's listening port */
    10611070    if( tr_bencDictFindInt( &val, "p", &i ) ) {
    1062         msgs->peer->port = htons( (uint16_t)i );
    1063         dbgmsg( msgs, "msgs->port is now %hu", msgs->peer->port );
     1071        fireClientGotPort( msgs, (tr_port)i );
     1072        dbgmsg( msgs, "peer's port is now %d", (int)i );
    10641073    }
    10651074
     
    14561465            tr_peerIoReadUint16( msgs->peer->io, inbuf, &msgs->peer->dht_port );
    14571466            if( msgs->peer->dht_port > 0 )
    1458                 tr_dhtAddNode( getSession(msgs), &msgs->peer->addr, msgs->peer->dht_port, 0 );
     1467                tr_dhtAddNode( getSession(msgs),
     1468                               tr_peerAddress( msgs->peer ),
     1469                               msgs->peer->dht_port, 0 );
    14591470            break;
    14601471
Note: See TracChangeset for help on using the changeset viewer.