[Reconnoiter-devel] [reconnoiter commit] r1308 - trunk/src/modules

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Tue May 25 21:29:08 EDT 2010


Author: jesus
Date: 2010-05-25 21:29:08 -0400 (Tue, 25 May 2010)
New Revision: 1308

Modified:
   trunk/src/modules/collectd.c
   trunk/src/modules/libstomp.c
   trunk/src/modules/lua.c
   trunk/src/modules/lua_dns.c
   trunk/src/modules/lua_noit.c
   trunk/src/modules/snmp.c
Log:
dead assignments, refs #283

Modified: trunk/src/modules/collectd.c
===================================================================
--- trunk/src/modules/collectd.c	2010-05-26 01:26:30 UTC (rev 1307)
+++ trunk/src/modules/collectd.c	2010-05-26 01:29:08 UTC (rev 1308)
@@ -541,7 +541,6 @@
   size_t exp_size = 2 * sizeof (uint16_t) + sizeof (uint64_t);
 
   uint16_t pkg_length;
-  uint16_t pkg_type;
 
   if ((buffer_len < 0) || ((size_t) buffer_len < exp_size))
   {
@@ -553,9 +552,8 @@
     return (-1);
   }
 
-  memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
+  /* skip pkg_type */
   buffer += sizeof (tmp16);
-  pkg_type = ntohs (tmp16);
 
   memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
   buffer += sizeof (tmp16);
@@ -581,7 +579,6 @@
   size_t header_size = 2 * sizeof (uint16_t);
 
   uint16_t pkg_length;
-  uint16_t pkg_type;
 
   if ((buffer_len < 0) || (buffer_len < header_size))
   {
@@ -593,9 +590,8 @@
     return (-1);
   }
 
-  memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
+  /* skip pkg_type */
   buffer += sizeof (tmp16);
-  pkg_type = ntohs (tmp16);
 
   memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
   buffer += sizeof (tmp16);
@@ -884,7 +880,7 @@
   memset (hash, 0, sizeof (hash));
   EVP_DigestInit(&ctx_md, EVP_sha1());
   EVP_DigestUpdate(&ctx_md, buffer + buffer_offset, payload_len);
-  err = EVP_DigestFinal(&ctx_md, hash, &hash_length);
+  EVP_DigestFinal(&ctx_md, hash, &hash_length);
   if (memcmp (hash, pea.hash, sizeof (hash)) != 0)
   {
     noitL(noit_error, "collectd: Decryption failed: Checksum mismatch.\n");

Modified: trunk/src/modules/libstomp.c
===================================================================
--- trunk/src/modules/libstomp.c	2010-05-26 01:26:30 UTC (rev 1307)
+++ trunk/src/modules/libstomp.c	2010-05-26 01:29:08 UTC (rev 1308)
@@ -107,13 +107,11 @@
 APR_DECLARE(apr_status_t) stomp_write_buffer(stomp_connection *connection, const char *data, apr_size_t size)
 {
    apr_size_t remaining = size;
-   size=0;
 	while( remaining>0 ) {
 		apr_size_t length = remaining;
 		apr_status_t rc = apr_socket_send(connection->socket, data, &length);
       data+=length;
       remaining -= length;
-      //      size += length;
       if( rc != APR_SUCCESS ) {
          return rc;
       }

Modified: trunk/src/modules/lua.c
===================================================================
--- trunk/src/modules/lua.c	2010-05-26 01:26:30 UTC (rev 1307)
+++ trunk/src/modules/lua.c	2010-05-26 01:29:08 UTC (rev 1308)
@@ -584,14 +584,12 @@
 noit_lua_log_results(noit_module_t *self, noit_check_t *check) {
   noit_lua_check_info_t *ci = check->closure;
   struct timeval duration;
-  u_int32_t duration_ms;
 
   gettimeofday(&ci->finish_time, NULL);
   sub_timeval(ci->finish_time, check->last_fire_time, &duration);
 
   memcpy(&ci->current.whence, &ci->finish_time, sizeof(ci->current.whence));
   ci->current.duration = duration.tv_sec * 1000 + duration.tv_usec / 1000;
-  duration_ms = ci->current.duration;
 
   noit_check_set_stats(self, check, &ci->current);
   free(ci->current.status);
@@ -606,7 +604,6 @@
   int result = -1, base;
   noit_module_t *self;
   noit_check_t *check;
-  check = ci->check;
 
   noitL(nldeb, "lua: %p resuming\n", ci->coro_state);
   result = lua_resume(ci->coro_state, nargs);
@@ -657,7 +654,6 @@
   noit_check_t *check;
   struct nl_intcl *int_cl = closure;
   noit_lua_check_info_t *ci = int_cl->ci;
-  check = ci->check;
   noitL(nldeb, "lua: %p ->check_timeout\n", ci->coro_state);
   ci->timed_out = 1;
   noit_lua_check_deregister_event(ci, e, 0);

Modified: trunk/src/modules/lua_dns.c
===================================================================
--- trunk/src/modules/lua_dns.c	2010-05-26 01:26:30 UTC (rev 1307)
+++ trunk/src/modules/lua_dns.c	2010-05-26 01:29:08 UTC (rev 1308)
@@ -251,7 +251,7 @@
   p.dnsp_qcls = 0;
   p.dnsp_qtyp = 0;
 
-  while((r = dns_nextrr(&p, &rr)) > 0) {
+  while(dns_nextrr(&p, &rr) > 0) {
     const char *fieldname = NULL;
     char buff[DNS_MAXDN], *txt_str, *c;
     int totalsize;
@@ -416,14 +416,13 @@
 int noit_lua_dns_index_func(lua_State *L) {
   int n;
   const char *k;
-  dns_lookup_ctx_t **udata, *obj;
+  dns_lookup_ctx_t **udata;
 
   n = lua_gettop(L);
   assert(n == 2);
   if(!luaL_checkudata(L, 1, "noit.dns"))
     luaL_error(L, "metatable error, arg1 is not a noit.dns");
   udata = lua_touserdata(L, 1);
-  obj = *udata;
   if(!lua_isstring(L, 2))
     luaL_error(L, "metatable error, arg2 is not a string");
   k = lua_tostring(L, 2);

Modified: trunk/src/modules/lua_noit.c
===================================================================
--- trunk/src/modules/lua_noit.c	2010-05-26 01:26:30 UTC (rev 1307)
+++ trunk/src/modules/lua_noit.c	2010-05-26 01:29:08 UTC (rev 1308)
@@ -658,9 +658,7 @@
   if(lua_isnumber(L, 2)) {
     cl->read_goal = lua_tointeger(L, 2);
     if(cl->read_goal <= cl->read_sofar) {
-      int base;
      i_know_better:
-      base = lua_gettop(L);
       /* We have enough, we can service this right here */
       lua_pushlstring(L, cl->inbuff, cl->read_goal);
       cl->read_sofar -= cl->read_goal;
@@ -821,14 +819,13 @@
 noit_eventer_index_func(lua_State *L) {
   int n;
   const char *k;
-  eventer_t *udata, e;
+  eventer_t *udata;
   n = lua_gettop(L); /* number of arguments */
   assert(n == 2);
   if(!luaL_checkudata(L, 1, "noit.eventer")) {
     luaL_error(L, "metatable error, arg1 not a noit.eventer!");
   }
   udata = lua_touserdata(L, 1);
-  e = *udata;
   if(!lua_isstring(L, 2)) {
     luaL_error(L, "metatable error, arg2 not a string!");
   }
@@ -1486,14 +1483,13 @@
 noit_xmlnode_index_func(lua_State *L) {
   int n;
   const char *k;
-  xmlNodePtr *udata, obj;
+  xmlNodePtr *udata;
   n = lua_gettop(L); /* number of arguments */
   assert(n == 2);
   if(!luaL_checkudata(L, 1, "noit.xmlnode")) {
     luaL_error(L, "metatable error, arg1 not a noit.xmlnode!");
   }
   udata = lua_touserdata(L, 1);
-  obj = *udata;
   if(!lua_isstring(L, 2)) {
     luaL_error(L, "metatable error, arg2 not a string!");
   }
@@ -1548,14 +1544,13 @@
 noit_xmldoc_index_func(lua_State *L) {
   int n;
   const char *k;
-  xmlDocPtr *udata, obj;
+  xmlDocPtr *udata;
   n = lua_gettop(L); /* number of arguments */
   assert(n == 2);
   if(!luaL_checkudata(L, 1, "noit.xmldoc")) {
     luaL_error(L, "metatable error, arg1 not a noit.xmldoc!");
   }
   udata = lua_touserdata(L, 1);
-  obj = *udata;
   if(!lua_isstring(L, 2)) {
     luaL_error(L, "metatable error, arg2 not a string!");
   }

Modified: trunk/src/modules/snmp.c
===================================================================
--- trunk/src/modules/snmp.c	2010-05-26 01:26:30 UTC (rev 1307)
+++ trunk/src/modules/snmp.c	2010-05-26 01:29:08 UTC (rev 1308)
@@ -386,7 +386,6 @@
 static netsnmp_pdu *
 convert_v1pdu_to_v2( netsnmp_pdu* template_v1pdu ) {
   netsnmp_pdu *template_v2pdu;
-  netsnmp_variable_list *first_vb;
   netsnmp_variable_list *var;
   oid enterprise[MAX_OID_LEN];
   size_t enterprise_len;
@@ -403,7 +402,6 @@
     return NULL;
   }
   template_v2pdu->command = SNMP_MSG_TRAP2;
-  first_vb = template_v2pdu->variables;
 
   /*
    * Insert an snmpTrapOID varbind before the original v1 varbind list



More information about the Reconnoiter-devel mailing list