Ignore:
Timestamp:
Nov 26, 2009, 6:47:08 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2610 "avoid unnecessary calls to time(NULL)"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/natpmp.c

    r9418 r9593  
    100100canSendCommand( const struct tr_natpmp * nat )
    101101{
    102     return time( NULL ) >= nat->commandTime;
     102    return tr_time( ) >= nat->commandTime;
    103103}
    104104
     
    106106setCommandTime( struct tr_natpmp * nat )
    107107{
    108     nat->commandTime = time( NULL ) + COMMAND_WAIT_SECS;
     108    nat->commandTime = tr_time( ) + COMMAND_WAIT_SECS;
    109109}
    110110
     
    190190            nat->state = TR_NATPMP_SEND_MAP;
    191191
    192         else if( nat->isMapped && time( NULL ) >= nat->renewTime )
     192        else if( nat->isMapped && tr_time( ) >= nat->renewTime )
    193193            nat->state = TR_NATPMP_SEND_MAP;
    194194    }
     
    215215            nat->state = TR_NATPMP_IDLE;
    216216            nat->isMapped = 1;
    217             nat->renewTime = time( NULL ) + LIFETIME_SECS;
     217            nat->renewTime = tr_time( ) + LIFETIME_SECS;
    218218            nat->port = resp.pnu.newportmapping.privateport;
    219219            tr_ninf( getKey( ), _(
Note: See TracChangeset for help on using the changeset viewer.