Changeset 12237


Ignore:
Timestamp:
Mar 26, 2011, 10:22:25 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) minor code cleanup in announcer-udp: whitespace & function names

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer-udp.c

    r12226 r12237  
    195195tau_scrape_request_free( struct tau_scrape_request * req )
    196196{
    197     tr_free( req->payload );
    198197    tr_free( req->response.errmsg );
    199198    tr_free( req->response.url );
     199    tr_free( req->payload );
    200200    tr_free( req );
    201201}
     
    223223
    224224static void
    225 on_scrape_response( tr_session                  * session,
    226                      struct tau_scrape_request  * request,
    227                      tau_action_t                 action,
    228                      struct evbuffer            * buf )
     225on_scrape_response( tr_session                 * session,
     226                    struct tau_scrape_request  * request,
     227                    tau_action_t                 action,
     228                    struct evbuffer            * buf )
    229229{
    230230    request->response.did_connect = true;
     
    378378
    379379static void
    380 on_announce_response( tr_session                  * session,
    381                      struct tau_announce_request  * request,
    382                      tau_action_t                   action,
    383                      struct evbuffer              * buf )
    384 {
     380on_announce_response( tr_session                   * session,
     381                      struct tau_announce_request  * request,
     382                      tau_action_t                   action,
     383                      struct evbuffer              * buf )
     384{
     385    const size_t buflen = evbuffer_get_length( buf );
     386
    385387    request->response.did_connect = true;
    386388    request->response.did_timeout = false;
    387389
    388     if( ( action == TAU_ACTION_ANNOUNCE )
    389         && ( evbuffer_get_length( buf ) >= 3*sizeof(uint32_t) ) )
     390    if( ( action == TAU_ACTION_ANNOUNCE ) && ( buflen >= 3*sizeof(uint32_t) ) )
    390391    {
    391392        tr_announce_response * resp = &request->response;
     
    402403    {
    403404        char * errmsg;
    404         const size_t buflen = evbuffer_get_length( buf );
    405405
    406406        if( ( action == TAU_ACTION_ERROR ) && ( buflen > 0 ) )
     
    532532    const time_t now = tr_time( );
    533533
    534     assert( tracker->is_asking_dns == 0 );
     534    assert( tracker->is_asking_dns == false );
    535535    assert( tracker->connecting_at == 0 );
    536536    assert( tracker->addr != NULL );
     
    560560            req->sent_at = now;
    561561            tau_tracker_send_request( tracker, req->payload, req->payload_len );
    562             if( req->callback == NULL) {
     562            if( req->callback == NULL ) {
    563563                tau_scrape_request_free( req );
    564564                tr_ptrArrayRemove( reqs, i );
     
    646646
    647647static bool
    648 tau_tracker_is_empty( const struct tau_tracker * tracker )
     648tau_tracker_is_idle( const struct tau_tracker * tracker )
    649649{
    650650    return tr_ptrArrayEmpty( &tracker->announces )
     
    665665
    666666    /* are there any requests pending? */
    667     if( tau_tracker_is_empty( tracker ) )
     667    if( tau_tracker_is_idle( tracker ) )
    668668        return;
    669669
     
    805805
    806806bool
    807 tr_tracker_udp_is_empty( const tr_session * session )
     807tr_tracker_udp_is_idle( const tr_session * session )
    808808{
    809809    int i;
     
    813813    if( tau != NULL )
    814814        for( i=0, n=tr_ptrArraySize(&tau->trackers); i<n; ++i )
    815             if( !tau_tracker_is_empty( tr_ptrArrayNth( &tau->trackers, i ) ) )
     815            if( !tau_tracker_is_idle( tr_ptrArrayNth( &tau->trackers, i ) ) )
    816816                return false;
    817817
  • trunk/libtransmission/announcer.h

    r12204 r12237  
    113113void tr_tracker_udp_close( tr_session * session );
    114114
    115 bool tr_tracker_udp_is_empty( const tr_session * session );
     115bool tr_tracker_udp_is_idle( const tr_session * session );
    116116
    117117
  • trunk/libtransmission/session.c

    r12229 r12237  
    17731773    /* gotta keep udp running long enough to send out all
    17741774       the &event=stopped UDP tracker messages */
    1775     while( !tr_tracker_udp_is_empty( session ) ) {
     1775    while( !tr_tracker_udp_is_idle( session ) ) {
    17761776        tr_tracker_udp_upkeep( session );
    17771777        tr_wait_msec( 100 );
Note: See TracChangeset for help on using the changeset viewer.