Hello,


Dave Shield wrote:

Remember that the get_{first,next}_data_point routines are used
to walk through the table in order to determine the appropriate
row to use.  This all happens before the main handler is called
to actually do the main task of answering the SNMP request.

This means that the table data must remain valid throughout.
Not just during the get_{first,next} walk, but afterwards too.
You can't safely release this until after the handler has completed.

Depending on exactly what you mean by "dynamic allocating",
one approach would be to free the table at the very end of
your handler routine.

Okay. I'have try this. Do my "malloc" in the "get_first" and the "free" at this end of "Handler".

But with this, when browse is out of range in "get_next" (I'm return
NULL) so Handler is not call... and so not freeing the table :/
Another idea?


  Alternatively, you could use the cache_handler to load
the table data before starting to process the table (instead
of doing this within get_first_data_point),  and use this for
a specified period before releasing it again.   That would
result in slightly stale data, but would probably prove a
bit more efficient - allowing the same table data to be used
for more than one SNMP request.

I need update table for sending it (like process running ...). But with iterator method , we browse table each time :/

Many thanks for your help :)

        bye bye.



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to