diff options
author | Roger Dingledine <arma@torproject.org> | 2002-11-24 08:45:54 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-11-24 08:45:54 +0000 |
commit | b097aa3288f6c964d86df1f765e6d07cce0ab0f7 (patch) | |
tree | 7c46b4c82f796eabe7405d9beb5087f50bbe5105 /src/or/main.c | |
parent | f50f35f2ecf71060d516646e3bbdeee3f73e7f8b (diff) | |
download | tor-b097aa3288f6c964d86df1f765e6d07cce0ab0f7.tar tor-b097aa3288f6c964d86df1f765e6d07cce0ab0f7.tar.gz |
per-second cell statistics to help with profiling
svn:r140
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/or/main.c b/src/or/main.c index 6d8961d25..ef35529d4 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -376,6 +376,7 @@ int prepare_for_poll(int *timeout) { for(i=0;i<nfds;i++) check_conn_marked(i); +#if 0 /* check if we need to refill buckets or zero out any per-second stats */ for(i=0;i<nfds;i++) { if(connection_receiver_bucket_should_increase(connection_array[i]) || @@ -384,8 +385,9 @@ int prepare_for_poll(int *timeout) { break; } } +#endif - if(need_to_wake_soon) { +// if(need_to_wake_soon) { if(now.tv_sec > current_second) { /* the second has already rolled over! */ // log(LOG_DEBUG,"prepare_for_poll(): The second has rolled over, immediately refilling."); for(i=0;i<nfds;i++) { @@ -393,11 +395,12 @@ int prepare_for_poll(int *timeout) { connection_array[i]->onions_handled_this_second = 0; } current_second = now.tv_sec; /* remember which second it is, for next time */ - } else { - /* this timeout is definitely sooner than any of the above ones */ - *timeout = 1000 - (now.tv_usec / 1000); /* how many milliseconds til the next second? */ } - } +// } else { + /* this timeout is definitely sooner than any of the above ones */ + *timeout = 1000 - (now.tv_usec / 1000); /* how many milliseconds til the next second? */ +// } +// } if(options.LinkPadding) { /* now check which conn wants to speak soonest */ @@ -530,7 +533,7 @@ int do_main_loop(void) { static void catch(int the_signal) { switch(the_signal) { - case SIGABRT: +// case SIGABRT: case SIGTERM: case SIGINT: log(LOG_NOTICE,"Catching signal %d, exiting cleanly.", the_signal); @@ -644,7 +647,7 @@ int main(int argc, char *argv[]) { int retval = 0; signal (SIGINT, catch); /* catch kills so we can exit cleanly */ - signal (SIGABRT, catch); +// signal (SIGABRT, catch); signal (SIGTERM, catch); signal (SIGUSR1, catch); /* to dump stats to stdout */ signal (SIGHUP, catch); /* to reload directory */ |