igmpproxy icon indicating copy to clipboard operation
igmpproxy copied to clipboard

Fix an error for timer execute

Open onesecret opened this issue 5 years ago • 3 comments

If not fix , this timer execute every 10s or more。 The variable secs must be assigned and less than 3.Because the timer cycle each 3 seconds.

onesecret avatar Mar 02 '20 06:03 onesecret

Could you please describe problem/error more deeply? After quick look I do not see what is the problem.

pali avatar Mar 02 '20 09:03 pali

at line 295: secs = timer_nextTimer();//here secs be assined, it can be 125 , 10, or others.its value depends on timer's queue->time. if not alter secs value, at line 341: curtime.tv_sec = lasttime.tv_sec + secs; curtime.tv_sec will too large, and cause difftime.tv_sec too large,
difftime.tv_sec is a param of function age_callout_queue. at this functioon, this param is compared with queue->time. if this param is larger than queue->time, this timer will be executed immediately. Actually, this param means how long the real time has passed. Did i make it clear ?

onesecret avatar Mar 03 '20 08:03 onesecret

Yes! I understood what you mean and how your change fixes (or rather workarounds?) this problem.

I wrote about this issue also in comment: https://github.com/pali/igmpproxy/pull/32#issuecomment-620887757

pali avatar May 08 '20 13:05 pali