+22 Aug 2013: Wouter
+ - more fixes that I overlooked.
+
21 Aug 2013: Wouter
- Fix#520: Errors found by static analysis from Tomas Hozza(redhat).
m->s.env->mesh->num_reply_addrs--;
end_time = *m->s.env->now_tv;
timeval_subtract(&duration, &end_time, &r->start_time);
- verbose(VERB_ALGO, "query took %d.%6.6d sec",
- (int)duration.tv_sec, (int)duration.tv_usec);
+ verbose(VERB_ALGO, "query took %lld.%6.6d sec",
+ (long long)duration.tv_sec, (int)duration.tv_usec);
m->s.env->mesh->replies_sent++;
timeval_add(&m->s.env->mesh->replies_sum_wait, &duration);
timehist_insert(m->s.env->mesh->histogram, &duration);
timeval_divide(&avg, &mesh->replies_sum_wait,
mesh->replies_sent);
log_info("average recursion processing time "
- "%d.%6.6d sec", (int)avg.tv_sec, (int)avg.tv_usec);
+ "%lld.%6.6d sec", (long long)avg.tv_sec, (int)avg.tv_usec);
log_info("histogram of recursion processing times");
timehist_log(mesh->histogram, "recursions");
}
(now.tv_sec == sq->last_sent_time.tv_sec &&
now.tv_usec > sq->last_sent_time.tv_usec)) {
/* convert from microseconds to milliseconds */
- int roundtime = ((int)now.tv_sec - (int)sq->last_sent_time.tv_sec)*1000
+ int roundtime = ((int)(now.tv_sec - sq->last_sent_time.tv_sec))*1000
+ ((int)now.tv_usec - (int)sq->last_sent_time.tv_usec)/1000;
verbose(VERB_ALGO, "measured TCP-time at %d msec", roundtime);
log_assert(roundtime >= 0);
(now.tv_sec == sq->last_sent_time.tv_sec &&
now.tv_usec > sq->last_sent_time.tv_usec)) {
/* convert from microseconds to milliseconds */
- int roundtime = ((int)now.tv_sec - (int)sq->last_sent_time.tv_sec)*1000
+ int roundtime = ((int)(now.tv_sec - sq->last_sent_time.tv_sec))*1000
+ ((int)now.tv_usec - (int)sq->last_sent_time.tv_usec)/1000;
verbose(VERB_ALGO, "measured roundtrip at %d msec", roundtime);
log_assert(roundtime >= 0);
ident, (int)getpid(), tid?*tid:0, type, message);
} else
#endif
- fprintf(logfile, "[%u] %s[%d:%x] %s: %s\n", (unsigned)now,
+ fprintf(logfile, "[%lld] %s[%d:%x] %s: %s\n", (long long)now,
ident, (int)getpid(), tid?*tid:0, type, message);
#ifdef UB_ON_WINDOWS
/* line buffering does not work on windows */
wait->tv_usec = p->ev_timeout.tv_usec
- now->tv_usec;
}
- verbose(VERB_CLIENT, "winsock_event wait=%d.%6.6d",
- (int)wait->tv_sec, (int)wait->tv_usec);
+ verbose(VERB_CLIENT, "winsock_event wait=%lld.%6.6d",
+ (long long)wait->tv_sec, (int)wait->tv_usec);
return;
}
#endif
int event_add(struct event *ev, struct timeval *tv)
{
- verbose(VERB_ALGO, "event_add %p added=%d fd=%d tv=%d %s%s%s",
+ verbose(VERB_ALGO, "event_add %p added=%d fd=%d tv=%lld %s%s%s",
ev, ev->added, ev->ev_fd,
- (tv?(int)tv->tv_sec*1000+(int)tv->tv_usec/1000:-1),
+ (tv?(long long)tv->tv_sec*1000+(long long)tv->tv_usec/1000:-1),
(ev->ev_events&EV_READ)?" EV_READ":"",
(ev->ev_events&EV_WRITE)?" EV_WRITE":"",
(ev->ev_events&EV_TIMEOUT)?" EV_TIMEOUT":"");
int event_del(struct event *ev)
{
- verbose(VERB_ALGO, "event_del %p added=%d fd=%d tv=%d %s%s%s",
+ verbose(VERB_ALGO, "event_del %p added=%d fd=%d tv=%lld %s%s%s",
ev, ev->added, ev->ev_fd,
- (ev->ev_events&EV_TIMEOUT)?(int)ev->ev_timeout.tv_sec*1000+
- (int)ev->ev_timeout.tv_usec/1000:-1,
+ (ev->ev_events&EV_TIMEOUT)?(long long)ev->ev_timeout.tv_sec*1000+
+ (long long)ev->ev_timeout.tv_usec/1000:-1,
(ev->ev_events&EV_READ)?" EV_READ":"",
(ev->ev_events&EV_WRITE)?" EV_WRITE":"",
(ev->ev_events&EV_TIMEOUT)?" EV_TIMEOUT":"");
#endif
tv.tv_usec = 0;
comm_timer_set(env->probe_timer, &tv);
- verbose(VERB_ALGO, "scheduled next probe in %d sec", (int)tv.tv_sec);
+ verbose(VERB_ALGO, "scheduled next probe in %lld sec", (long long)tv.tv_sec);
}
/** set next probe for trust anchor */