Welcome! Log In Create A New Profile

Advanced

Re: a digest authentication module

Samizdat Drafting Co.
November 17, 2011 04:30PM
On Sat, Nov 5, 2011 at 8:50 PM, Alexandr Gomoliako <zzz@zzz.org.ua> wrote:

>> i'm also a little confused as to how the module should schedule a
>> recurring node-expiration callback that purges stale entries from the
>> rbtree. at the moment the purge function is called at the top of every
>> request, which feels like the wrongest possible way to do it. i've
>> seen mention of the cleanup hook attached to the request's pool. is
>> this a more appropriate place to run or are there other problems
>> associated with that?
>
> Well, it's up to you to decide. But since entries are completely unrelated
> to the request you should probably move expiration somewhere else.

very true. i've switched over to creating a timer at module init-time
that schedules itself every few seconds and calls the expiration
routine as needed. it seems to be working, but i'm wondering if i've
introduced a memory leak in the process.

the relevant portion of the code is excerpted at https://gist.github.com/1374529

i didn't see a way to create a recurring timer and instead the event
handler calls ngx_add_timer() every time it is triggered (each time
re-using the same ngx_event_t pointer i set up initially).

do i also need to be calling ngx_event_del_timer to clean up after
myself, or does the ngx_event_expire_timers get called by nginx itself
and handle this potential leak?

or more simply, is there a way to create a timer that fires every n
seconds and doesn't need to be re-added each time it fires? i
experimented with setting the "oneshot" field to 0 but apparently it's
not quite that simple...

thanks again,
christian

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

a digest authentication module

Samizdat Drafting Co. 1777 November 05, 2011 03:36PM

Re: a digest authentication module

Alexandr Gomoliako 586 November 05, 2011 08:52PM

Re: a digest authentication module

Samizdat Drafting Co. 447 November 17, 2011 04:30PM

Re: a digest authentication module

Alexandr Gomoliako 736 November 17, 2011 05:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready