- more fixes that I overlooked.

git-svn-id: file:///svn/unbound/trunk@2944 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2013-08-22 07:33:51 +00:00
parent 3a5766d35e
commit c845aceee4
6 changed files with 17 additions and 14 deletions

View file

@ -1,3 +1,6 @@
22 Aug 2013: Wouter
- more fixes that I overlooked.
21 Aug 2013: Wouter
- Fix#520: Errors found by static analysis from Tomas Hozza(redhat).

View file

@ -878,8 +878,8 @@ mesh_send_reply(struct mesh_state* m, int rcode, struct reply_info* rep,
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);
@ -1124,7 +1124,7 @@ mesh_stats(struct mesh_area* mesh, const char* str)
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");
}

View file

@ -1567,7 +1567,7 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error,
(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);
@ -1753,7 +1753,7 @@ serviced_udp_callback(struct comm_point* c, void* arg, int error,
(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);

View file

@ -228,7 +228,7 @@ log_vmsg(int pri, const char* type,
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 */

View file

@ -181,8 +181,8 @@ static void handle_timeouts(struct event_base* base, struct timeval* now,
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
@ -488,9 +488,9 @@ int event_base_set(struct event_base *base, struct event *ev)
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":"");
@ -569,10 +569,10 @@ int event_add(struct event *ev, struct timeval *tv)
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":"");

View file

@ -1804,7 +1804,7 @@ reset_worker_timer(struct module_env* env)
#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 */