Changeset a5e761d52d97a6681d7c9db3a7707d8af31852f5
- Timestamp:
- 05/26/10 01:29:08
(3 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1274837348 +0000
- git-parent:
[c4b13341984038de842402b66aa48c0852c1c4a1]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1274837348 +0000
- Message:
dead assignments, refs #283
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r9c84154 |
ra5e761d |
|
| 542 | 542 | |
|---|
| 543 | 543 | uint16_t pkg_length; |
|---|
| 544 | | uint16_t pkg_type; |
|---|
| 545 | 544 | |
|---|
| 546 | 545 | if ((buffer_len < 0) || ((size_t) buffer_len < exp_size)) |
|---|
| … | … | |
| 554 | 553 | } |
|---|
| 555 | 554 | |
|---|
| 556 | | memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); |
|---|
| | 555 | /* skip pkg_type */ |
|---|
| 557 | 556 | buffer += sizeof (tmp16); |
|---|
| 558 | | pkg_type = ntohs (tmp16); |
|---|
| 559 | 557 | |
|---|
| 560 | 558 | memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); |
|---|
| … | … | |
| 582 | 580 | |
|---|
| 583 | 581 | uint16_t pkg_length; |
|---|
| 584 | | uint16_t pkg_type; |
|---|
| 585 | 582 | |
|---|
| 586 | 583 | if ((buffer_len < 0) || (buffer_len < header_size)) |
|---|
| … | … | |
| 594 | 591 | } |
|---|
| 595 | 592 | |
|---|
| 596 | | memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); |
|---|
| | 593 | /* skip pkg_type */ |
|---|
| 597 | 594 | buffer += sizeof (tmp16); |
|---|
| 598 | | pkg_type = ntohs (tmp16); |
|---|
| 599 | 595 | |
|---|
| 600 | 596 | memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); |
|---|
| … | … | |
| 885 | 881 | EVP_DigestInit(&ctx_md, EVP_sha1()); |
|---|
| 886 | 882 | EVP_DigestUpdate(&ctx_md, buffer + buffer_offset, payload_len); |
|---|
| 887 | | err = EVP_DigestFinal(&ctx_md, hash, &hash_length); |
|---|
| | 883 | EVP_DigestFinal(&ctx_md, hash, &hash_length); |
|---|
| 888 | 884 | if (memcmp (hash, pea.hash, sizeof (hash)) != 0) |
|---|
| 889 | 885 | { |
|---|
| r7afb4e3 |
ra5e761d |
|
| 108 | 108 | { |
|---|
| 109 | 109 | apr_size_t remaining = size; |
|---|
| 110 | | size=0; |
|---|
| 111 | 110 | while( remaining>0 ) { |
|---|
| 112 | 111 | apr_size_t length = remaining; |
|---|
| … | … | |
| 114 | 113 | data+=length; |
|---|
| 115 | 114 | remaining -= length; |
|---|
| 116 | | // size += length; |
|---|
| 117 | 115 | if( rc != APR_SUCCESS ) { |
|---|
| 118 | 116 | return rc; |
|---|
| ra719cb6 |
ra5e761d |
|
| 585 | 585 | noit_lua_check_info_t *ci = check->closure; |
|---|
| 586 | 586 | struct timeval duration; |
|---|
| 587 | | u_int32_t duration_ms; |
|---|
| 588 | 587 | |
|---|
| 589 | 588 | gettimeofday(&ci->finish_time, NULL); |
|---|
| … | … | |
| 592 | 591 | memcpy(&ci->current.whence, &ci->finish_time, sizeof(ci->current.whence)); |
|---|
| 593 | 592 | ci->current.duration = duration.tv_sec * 1000 + duration.tv_usec / 1000; |
|---|
| 594 | | duration_ms = ci->current.duration; |
|---|
| 595 | 593 | |
|---|
| 596 | 594 | noit_check_set_stats(self, check, &ci->current); |
|---|
| … | … | |
| 607 | 605 | noit_module_t *self; |
|---|
| 608 | 606 | noit_check_t *check; |
|---|
| 609 | | check = ci->check; |
|---|
| 610 | 607 | |
|---|
| 611 | 608 | noitL(nldeb, "lua: %p resuming\n", ci->coro_state); |
|---|
| … | … | |
| 658 | 655 | struct nl_intcl *int_cl = closure; |
|---|
| 659 | 656 | noit_lua_check_info_t *ci = int_cl->ci; |
|---|
| 660 | | check = ci->check; |
|---|
| 661 | 657 | noitL(nldeb, "lua: %p ->check_timeout\n", ci->coro_state); |
|---|
| 662 | 658 | ci->timed_out = 1; |
|---|
| ra719cb6 |
ra5e761d |
|
| 252 | 252 | p.dnsp_qtyp = 0; |
|---|
| 253 | 253 | |
|---|
| 254 | | while((r = dns_nextrr(&p, &rr)) > 0) { |
|---|
| | 254 | while(dns_nextrr(&p, &rr) > 0) { |
|---|
| 255 | 255 | const char *fieldname = NULL; |
|---|
| 256 | 256 | char buff[DNS_MAXDN], *txt_str, *c; |
|---|
| … | … | |
| 417 | 417 | int n; |
|---|
| 418 | 418 | const char *k; |
|---|
| 419 | | dns_lookup_ctx_t **udata, *obj; |
|---|
| | 419 | dns_lookup_ctx_t **udata; |
|---|
| 420 | 420 | |
|---|
| 421 | 421 | n = lua_gettop(L); |
|---|
| … | … | |
| 424 | 424 | luaL_error(L, "metatable error, arg1 is not a noit.dns"); |
|---|
| 425 | 425 | udata = lua_touserdata(L, 1); |
|---|
| 426 | | obj = *udata; |
|---|
| 427 | 426 | if(!lua_isstring(L, 2)) |
|---|
| 428 | 427 | luaL_error(L, "metatable error, arg2 is not a string"); |
|---|
| ra719cb6 |
ra5e761d |
|
| 659 | 659 | cl->read_goal = lua_tointeger(L, 2); |
|---|
| 660 | 660 | if(cl->read_goal <= cl->read_sofar) { |
|---|
| 661 | | int base; |
|---|
| 662 | 661 | i_know_better: |
|---|
| 663 | | base = lua_gettop(L); |
|---|
| 664 | 662 | /* We have enough, we can service this right here */ |
|---|
| 665 | 663 | lua_pushlstring(L, cl->inbuff, cl->read_goal); |
|---|
| … | … | |
| 822 | 820 | int n; |
|---|
| 823 | 821 | const char *k; |
|---|
| 824 | | eventer_t *udata, e; |
|---|
| | 822 | eventer_t *udata; |
|---|
| 825 | 823 | n = lua_gettop(L); /* number of arguments */ |
|---|
| 826 | 824 | assert(n == 2); |
|---|
| … | … | |
| 829 | 827 | } |
|---|
| 830 | 828 | udata = lua_touserdata(L, 1); |
|---|
| 831 | | e = *udata; |
|---|
| 832 | 829 | if(!lua_isstring(L, 2)) { |
|---|
| 833 | 830 | luaL_error(L, "metatable error, arg2 not a string!"); |
|---|
| … | … | |
| 1487 | 1484 | int n; |
|---|
| 1488 | 1485 | const char *k; |
|---|
| 1489 | | xmlNodePtr *udata, obj; |
|---|
| | 1486 | xmlNodePtr *udata; |
|---|
| 1490 | 1487 | n = lua_gettop(L); /* number of arguments */ |
|---|
| 1491 | 1488 | assert(n == 2); |
|---|
| … | … | |
| 1494 | 1491 | } |
|---|
| 1495 | 1492 | udata = lua_touserdata(L, 1); |
|---|
| 1496 | | obj = *udata; |
|---|
| 1497 | 1493 | if(!lua_isstring(L, 2)) { |
|---|
| 1498 | 1494 | luaL_error(L, "metatable error, arg2 not a string!"); |
|---|
| … | … | |
| 1549 | 1545 | int n; |
|---|
| 1550 | 1546 | const char *k; |
|---|
| 1551 | | xmlDocPtr *udata, obj; |
|---|
| | 1547 | xmlDocPtr *udata; |
|---|
| 1552 | 1548 | n = lua_gettop(L); /* number of arguments */ |
|---|
| 1553 | 1549 | assert(n == 2); |
|---|
| … | … | |
| 1556 | 1552 | } |
|---|
| 1557 | 1553 | udata = lua_touserdata(L, 1); |
|---|
| 1558 | | obj = *udata; |
|---|
| 1559 | 1554 | if(!lua_isstring(L, 2)) { |
|---|
| 1560 | 1555 | luaL_error(L, "metatable error, arg2 not a string!"); |
|---|
| r9efbd3a |
ra5e761d |
|
| 387 | 387 | convert_v1pdu_to_v2( netsnmp_pdu* template_v1pdu ) { |
|---|
| 388 | 388 | netsnmp_pdu *template_v2pdu; |
|---|
| 389 | | netsnmp_variable_list *first_vb; |
|---|
| 390 | 389 | netsnmp_variable_list *var; |
|---|
| 391 | 390 | oid enterprise[MAX_OID_LEN]; |
|---|
| … | … | |
| 404 | 403 | } |
|---|
| 405 | 404 | template_v2pdu->command = SNMP_MSG_TRAP2; |
|---|
| 406 | | first_vb = template_v2pdu->variables; |
|---|
| 407 | 405 | |
|---|
| 408 | 406 | /* |
|---|