Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

igmpproxy timer execute error #58

Open
onesecret opened this issue Feb 29, 2020 · 3 comments
Open

igmpproxy timer execute error #58

onesecret opened this issue Feb 29, 2020 · 3 comments

Comments

@onesecret
Copy link

diff --git a/src/igmpproxy.c b/src/igmpproxy.c
index 9d1172b..46a659b 100644
--- a/src/igmpproxy.c
b/src/igmpproxy.c
@@ -297,7 297,7 @@ void igmpProxyRun(void) {
timeout = NULL;
} else {
timeout->tv_nsec = 0;
- timeout->tv_sec = (secs > 3) ? 3 : secs; // aimwang: set max timeout
timeout->tv_sec = secs = (secs > 3) ? 3 : secs; // aimwang: set max timeout
}

     // Prepare for select.

it cause a problem at :

    // At this point, we can handle timeouts...
    do {
        /*
         * If the select timed out, then there's no other
         * activity to account for and we don't need to
         * call gettimeofday.
         */
        if (Rt == 0) {
            curtime.tv_sec = lasttime.tv_sec   secs;
            curtime.tv_nsec = lasttime.tv_nsec;
            Rt = -1; /* don't do this next time through the loop */
        } else {
            clock_gettime(CLOCK_MONOTONIC, &curtime);
        }
        difftime.tv_sec = curtime.tv_sec - lasttime.tv_sec;
        difftime.tv_nsec  = curtime.tv_nsec - lasttime.tv_nsec;
        while (difftime.tv_nsec > 1000000000) {
            difftime.tv_sec  ;
            difftime.tv_nsec -= 1000000000;
        }
        if (difftime.tv_nsec < 0) {
            difftime.tv_sec--;
            difftime.tv_nsec  = 1000000000;
        }
        lasttime = curtime;
        if (secs == 0 || difftime.tv_sec > 0)
            age_callout_queue(difftime.tv_sec);
        secs = -1;
    } while (difftime.tv_sec > 0);
@onesecret
Copy link
Author

I want to push a commit for it , but I don't how to do .
it likes this:

onesecret@onesecret-Vostro-3470:~/igmpproxy$ git push origin HEAD:refs/for/master
Username for 'https://github.com': onesecret
Password for 'https://[email protected]':
remote: Permission to pali/igmpproxy.git denied to onesecret.
fatal: unable to access 'https://github.com/pali/igmpproxy.git/': The requested URL returned error: 403

can I push a commit ? It looks like I have no permission.

@pali
Copy link
Owner

pali commented Feb 29, 2020

Hello! You first need to create your own fork of this repository, then push changes inyo your own fork and later create a pull request for including changes of your fork into main igmpproxy repository agin. See official help guidelines with screenshots from github how to fork repository and how to create a pull requests, this should help you:
https://help.github.com/en/github/getting-started-with-github/fork-a-repo
https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork
Also you should be able to edit file directly on github and changes would be saved to your personal fork (after that is needed to create a pull request).

@onesecret
Copy link
Author

Thank you, I'll try it

Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 26, 2020
First PR for a complete rewrite of igmpproxy. This rewrite will
include several fixes, and new functionality.

This PR changes callout.c to a simpler and more stable callout queue
algorithm.
Also igmpproxy.c is sanitized and the main event loop based on the new
callout queue.
Several structs and variables are moved to igmpproxy.h, a few prototypes
added and sanitized into the unified style.
config.c is modified slightly to add NULL pointers for new blacklists that
will be added.

Fixes: pali#58
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 26, 2020
First PR for a complete rewrite of igmpproxy. This rewrite will
include several fixes, and new functionality.

This PR changes callout.c to a simpler and more stable callout queue
algorithm.
Also igmpproxy.c is sanitized and the main event loop based on the new
callout queue.
Several structs and variables are moved to igmpproxy.h, a few prototypes
added and sanitized into the unified style.
config.c is modified slightly to add NULL pointers for new blacklists that
will be added.

Fixes: pali#58
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 26, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Also several variables and structs were moved to igmpproxy.h in preperation
to coming changes.
Includes minor changes to config.c and request.c to include new blacklists
for interfaces.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 26, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Also several variables and structs were moved to igmpproxy.h in preperation
to coming changes.
Includes minor changes to config.c and request.c to include new blacklists
for interfaces.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 26, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Also several variables and structs were moved to igmpproxy.h in preperation
to coming changes.
Includes minor changes to config.c and request.c to include new blacklists
for interfaces.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 26, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Also several variables and structs were moved to igmpproxy.h in preperation
to coming changes.
Includes minor changes to config.c and request.c to include new blacklists
for interfaces.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 27, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Also several variables and structs were moved to igmpproxy.h in preperation
to coming changes.
Includes minor changes to config.c and request.c to include new blacklists
for interfaces.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58

Fixed a few typos and comments
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue May 30, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Also several variables and structs were moved to igmpproxy.h in preperation
to coming changes.
Includes minor changes to config.c and request.c to include new blacklists
for interfaces.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58

Fixed a few typos and comments

Added sighup_action to struct Config
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue Jun 20, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Includes minor changes to config.c and request.c to include add name for timers.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58

Fixed a few typos and comments

Updated Timing Algorithm

Timers are now kept with a struct timespec, so they are much mnore acurately scheduled.
Added a name to the timeoutqueue struct, improves debugging timers by a bunch.
Renamed timer functions to be more in line with style
time_ageQueue() now returns ns until next timer if scheduled in less then 1s.
                this makes timer execuation really accurate. Timers are not missed by more than a few 1/100s
Updated syslog.c to add timestamp when logging to stderr.
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue Jun 20, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Includes minor changes to config.c and request.c to include add name for timers.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58

Fixed a few typos and comments

Updated Timing Algorithm

Timers are now kept with a struct timespec, so they are much mnore acurately scheduled.
Added a name to the timeoutqueue struct, improves debugging timers by a bunch.
Renamed timer functions to be more in line with style
time_ageQueue() now returns ns until next timer if scheduled in less then 1s.
                this makes timer execuation really accurate. Timers are not missed by more than a few 1/100s
Updated syslog.c to add timestamp when logging to stderr.
Uglymotha added a commit to Uglymotha/igmpv3proxy that referenced this issue Jun 20, 2020
This commit contains a number of changes to the timing structure and
main event loops.
Includes minor changes to config.c and request.c to include add name for timers.
callout.c is modified to a simpler and more stable algorithm.
igmpproxy.h and igmpproxy.c are sanitized and adopted to the new callout queue.

FIXES: pali#58

Fixed a few typos and comments

Updated Timing Algorithm

Timers are now kept with a struct timespec, so they are much mnore acurately scheduled.
Added a name to the timeoutqueue struct, improves debugging timers by a bunch.
Renamed timer functions to be more in line with style
time_ageQueue() now returns ns until next timer if scheduled in less then 1s.
                this makes timer execuation really accurate. Timers are not missed by more than a few 1/100s
Updated syslog.c to add timestamp when logging to stderr.

void debugQeueu(VOID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants