Changeset 4f91a9df3464c7910b541eb625d8bbb3e11b0058

Show
Ignore:
Timestamp:
01/30/09 17:15:18 (10 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1233335718 +0000
git-parent:

[c8af4b31a3f9b713f944d3c71e60bf1a666f1088]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1233335718 +0000
Message:

This bug totally sucks. I hate C. I love you C.

This short copy would cause the check to report an erroneously high duration
(to the tune of the lesser of half the period of the check or 1 second).

closes #88

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/http.c

    rdb656f3 r4f91a9d  
    387387  if(!NOIT_CHECK_DISABLED(ccl->check) && !NOIT_CHECK_KILLED(ccl->check)) { 
    388388    serf_check_info_t *ci = ccl->check->closure; 
    389     memcpy(&ci->finish_time, now, sizeof(*now)); 
     389    if(ci->finish_time.tv_sec == 0 && ci->finish_time.tv_usec == 0) 
     390      memcpy(&ci->finish_time, now, sizeof(*now)); 
    390391    generic_log_results(ccl->self, ccl->check); 
    391392  } 
     
    556557 finish: 
    557558  gettimeofday(&ci->finish_time, NULL); 
     559  noitL(nldeb, "serf finished request (%s) [%d.%06d]\n", ctx->check->target, 
     560        ci->finish_time.tv_sec, ci->finish_time.tv_usec); 
    558561  if(ci->timeout_event) { 
    559562    eventer_remove(ci->timeout_event); 
    560563    ci->timed_out = 0; 
    561564    memcpy(&ci->timeout_event->whence, &ci->finish_time, 
    562            sizeof(&ci->finish_time)); 
     565           sizeof(ci->finish_time)); 
    563566    eventer_add(ci->timeout_event); 
    564567  } 
     
    718721  gettimeofday(&when, NULL); 
    719722  memcpy(&check->last_fire_time, &when, sizeof(when)); 
     723  ci->finish_time.tv_sec = ci->finish_time.tv_usec = 0L; 
    720724 
    721725  ccl = apr_pcalloc(ci->pool, sizeof(*ccl));