--=-rznq+4ZF5V80ehfjynSx
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hello!

I have a couple of patches which I think would be good to add, does
anyone have any comments?

cache_handler-always-log-tag:
Make sure that all debug lines are decorated with the tag that
controls the log.

hr_proc-log-in-right-domain:
Make the debug tag a bit more similar to other debug tags.

shutdown_mib-cleans-up:
Make shutdown_mib deallcate all allocated memory.

/MF

--=-rznq+4ZF5V80ehfjynSx
Content-Disposition: attachment; filename=cache_handler-always-log-tag
Content-Type: text/x-patch; name=cache_handler-always-log-tag;
charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Index: agent/helpers/cache_handler.c
================================================== =================
--- agent/helpers/cache_handler.c (revision 16348)
+++ agent/helpers/cache_handler.c (working copy)
@@ -385,14 +385,14 @@ int
netsnmp_cache_check_and_reload(netsnmp_cache * cache)
{
if (!cache) {
- DEBUGMSG(("helper:cache_handler", " no cache\n"));
+ DEBUGMSGT(("helper:cache_handler", " no cache\n"));
return 0; /* ?? or -1 */
}
if (!cache->valid || netsnmp_cache_check_expired(cache))
return _cache_load( cache );
else {
- DEBUGMSG(("helper:cache_handler", " cached (%d)\n",
- cache->timeout));
+ DEBUGMSGT(("helper:cache_handler", " cached (%d)\n",
+ cache->timeout));
return 0;
}
}
@@ -437,8 +437,8 @@ netsnmp_cache_helper_handler(netsnmp_mib
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
NETSNMP_DS_AGENT_NO_CACHING) ||
!cache || !cache->enabled || !cache->load_cache) {
- DEBUGMSG(("helper:cache_handler", " caching disabled or "
- "cache not found, disabled or had no load method\n"));
+ DEBUGMSGT(("helper:cache_handler", " caching disabled or "
+ "cache not found, disabled or had no load method\n"));
return SNMP_ERR_NOERROR;
}


--=-rznq+4ZF5V80ehfjynSx
Content-Disposition: attachment; filename=hr_proc-log-in-right-domain
Content-Type: text/x-patch; name=hr_proc-log-in-right-domain;
charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Index: agent/mibgroup/host/hr_proc.c
================================================== =================
--- agent/mibgroup/host/hr_proc.c (revision 16348)
+++ agent/mibgroup/host/hr_proc.c (working copy)
@@ -185,7 +185,7 @@ var_hrproc(struct variable * vp,
long_return = 0;
return (u_char *) & long_return;
default:
- DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrproc\n",
+ DEBUGMSGTL(("host/hr_proc", "unknown sub-id %d in var_hrproc\n",
vp->magic));
}
return NULL;

--=-rznq+4ZF5V80ehfjynSx
Content-Disposition: attachment; filename=shutdown_mib-cleans-up
Content-Type: text/x-patch; name=shutdown_mib-cleans-up; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Index: snmplib/mib.c
================================================== =================
--- snmplib/mib.c (revision 16348)
+++ snmplib/mib.c (working copy)
@@ -2867,10 +2867,21 @@ shutdown_mib(void)
}
tree_head = NULL;
Mib = NULL;
+ if (_mibindexes) {
+ int i;
+ for (i = 0; i < _mibindex; ++i)
+ SNMP_FREE(_mibindexes[i]);
+ free(_mibindexes);
+ _mibindex = 0;
+ _mibindex_max = 0;
+ _mibindexes = NULL;
+ }
if (Prefix != NULL && Prefix != &Standard_Prefix[0])
SNMP_FREE(Prefix);
if (Prefix)
Prefix = NULL;
+ SNMP_FREE(confmibs);
+ SNMP_FREE(confmibdir);
}

/**

--=-rznq+4ZF5V80ehfjynSx
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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/
--=-rznq+4ZF5V80ehfjynSx
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--=-rznq+4ZF5V80ehfjynSx--