Report zero duration in http-resp, http-metrics w/o request
@@ -224,12 +224,14 @@ doHttpHeader(protocol_info *proto)
rps = map->frequency / sec;
}
- map->duration = getDurationNow(post->start_duration, map->start_time);
- map->duration = map->duration / 1000;
map->resp = (char *)post->hdr;
if (!map->req) {
map->req = strdup("None");
+ map->duration = 0;
+ } else {
+ map->duration = getDurationNow(post->start_duration, map->start_time);
+ map->duration = map->duration / 1000;
}
event_field_t hfields[] = {
