Navigation


Changeset 1109:4f33090b96bf in freeDiameter


Ignore:
Timestamp:
May 13, 2013, 11:12:10 AM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Fix handling of the timeout value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rt_busypeers/rtbusy.c

    r1108 r1109  
    149149        /* If the message is a request, we only associate the timeout */
    150150        if (hdr->msg_flags & CMD_FLAG_REQUEST) {
    151                 struct timespec tm = { .tv_sec = rtbusy_conf.RelayTimeout/1000, .tv_nsec=1000000LL * (rtbusy_conf.RelayTimeout % 1000) };
    152                 CHECK_FCT( fd_msg_anscb_associate( *pmsg, NULL, NULL, rtbusy_expirecb, &tm ) );
     151                struct timespec expire;
     152                CHECK_SYS(  clock_gettime(CLOCK_REALTIME, &expire)  );
     153                expire.tv_sec += rtbusy_conf.RelayTimeout/1000 + ((expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) / 1000000000LL);
     154                expire.tv_nsec = (expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) % 1000000000LL;
     155                CHECK_FCT( fd_msg_anscb_associate( *pmsg, NULL, NULL, rtbusy_expirecb, &expire ) );
    153156                return 0;
    154157        }
Note: See TracChangeset for help on using the changeset viewer.