> GW> In the iterator irreversible_commit
> "CONTAINER_REMOVE" call
> GW> am I responsible for the container -
> "
_if_ctx.container" or
> GW> is this an internal thing to Net-SNMP?
>
> RS> That container is the 'iterator container' that is used to
> RS> iterate over your data.
>
> RS> So, unless you are actually deleting a row here, it shouldn't
> RS> be calling REMOVE. It's calling REMOVE because of the flags
> RS> we added in the allocate function, so go ahead and delete that

code.
>
> RS> Instead, make the release call in _mfd_
_post_request (in
> RS>
_interface.c) unconditional.
>


OK, I've done that and it still fixes the memory leak

However I still have problems when inserting a new Row - see below for
the Debug (error on subcontainer '' insert (-1))
The table does have a RowStatus column which is used when creating the
Rows for this table (I use CreateAndGo to create the rows). Some debug
is shown at the end for you, however your question below made me
think... For most of my tables the rows are created/deleted by a
component external to the agent (which is why I was using this handler)
hence the tables are read-only and have no RowStatus column.

However this table is an exception to my rule - the rows are
created/deleted by a manager but used by the external component So I
guess I could use a different mib2c config (one of the more standard
implementations) for this table as long as I could grant access to my
external component by some means (any suggestions or any reason why I
couldn't do this?).
I was simply using the same mfd iterator handler to maintain commonality
across my agent - but I don't have to. Of course if I didn't use this
handler we wouldn't fix the problems I've found Maybe you'd at least
like me to continue to help debug this ready for the next poor guy who
needs to use it.

>
> GW> Also, if I try to create a row which already exists (i.e. has a
> GW> duplicate index) then the iterator finds that index is
> there already
> GW> (iterates through until it comes to that index) - but
> then the code
> GW> still seems to continue to try and add the row rather
> than return an
> GW> error. Do I need to implement this check somewhere - or
> should the
> GW> net-snmp code handle this and return the error?
>
> RS> How are you trying to 'create a row'? Does the table have a
> RS> RowStatus column?
> RS> Or do rows spring into existence any time they are accessed?
>


See my answer above - it has a RowStatus column so I use snmpset to
create a row (using CreateAndGo on the RowStatus).

>
> RS> Now, since you are creating rows, I assume you'll be removing
> RS> them as well.
> RS> Since you data source is external, there are 2 ways to handle
> RS> that... The simplest would be to just do what you need to do
> RS> in
_irreversible_commit, if it exists. If it doesn't,
> RS> you'll have to set up a remove_data callback for the
> RS> iterator_container.
>
> RS> void netsnmp_container_iterator_set_data_cb(netsnmp_con tainer

*c,
> RS> Netsnmp_Iterator_Data * insert_data,
> RS> Netsnmp_Iterator_Data * remove_data,
> RS> Netsnmp_Iterator_Op * get_size)
>


There's a "_mfd_
_irreversible_commit" function in the interface
file. So I could use that.

------- DEBUG showing error on insert of a new row.
.....
.....
internal:
:_mfd_
_set_values: called
internal:
:_
_set_column: called for 2
verbose:
:ParameterRowStatus_set: called
internal:
:_
_set_column: called for 3
verbose:
:ParameterKey_set: called
internal:
:_
_set_column: called for 4
verbose:
:ParameterValue_set: called
internal:
:_
_set_column: called for 5
verbose:
:ParameterId_set: called
internal:
:_mfd_
_commit: called
verbose:
:
_commit: called
internal:
:_mfd_
_irreversible:commit: called
error on subcontainer '' insert (-1)
internal:
:_mfd_
_undo_cleanup: called
verbose:
:
_undo_cleanup: called
verbose:
:
_release_data: called
internal:
:_mfd_
_post_request: called
internal:
:
_release_rowreq_ctx: called
verbose:
:
_post_request: called


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders