summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-07-16 18:24:12 +0000
committerRoger Dingledine <arma@torproject.org>2002-07-16 18:24:12 +0000
commitccdef66b68a2f61dfe600fddafaf270537928fac (patch)
tree0f61829d0bb20664ad88e51178e19656165ae725 /src/or/main.c
parent53cec4caef1443dc157d40d55849df1deb8d83e2 (diff)
downloadtor-ccdef66b68a2f61dfe600fddafaf270537928fac.tar.gz
tor-ccdef66b68a2f61dfe600fddafaf270537928fac.zip
new link padding scheme
we're now much more robust when bandwidth varies: instead of forcing a fixed bandwidth on the link, we instead use what the link will give us, up to our bandwidth. svn:r53
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 69dc4a241b..f50bff8e5d 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -344,10 +344,10 @@ int prepare_for_poll(int *timeout) {
if(!connection_state_is_open(tmpconn))
continue; /* only conns in state 'open' have a valid send_timeval */
while(tv_cmp(&tmpconn->send_timeval,&now) <= 0) { /* send_timeval has already passed, let it send a cell */
- log(LOG_DEBUG,"prepare_for_poll(): doing backlogged connection_send_cell on socket %d (%d ms old)",tmpconn->s,
- (now.tv_sec - tmpconn->send_timeval.tv_sec)*1000 +
- (now.tv_usec - tmpconn->send_timeval.tv_usec)/1000
- );
+// log(LOG_DEBUG,"prepare_for_poll(): doing backlogged connection_send_cell on socket %d (%d ms old)",tmpconn->s,
+// (now.tv_sec - tmpconn->send_timeval.tv_sec)*1000 +
+// (now.tv_usec - tmpconn->send_timeval.tv_usec)/1000
+// );
connection_send_cell(tmpconn);
}
if(!conn || tv_cmp(&tmpconn->send_timeval, &soonest) < 0) { /* this is the best choice so far */
@@ -424,11 +424,13 @@ int do_main_loop(void) {
/* poll until we have an event, or it's time to do something */
poll_result = poll(poll_array, nfds, timeout);
+#if 0 /* let catch() handle things like ^c, and otherwise don't worry about it */
if(poll_result < 0) {
log(LOG_ERR,"do_main_loop(): poll failed.");
if(errno != EINTR) /* let the program survive things like ^z */
return -1;
}
+#endif
if(poll_result > 0) { /* we have at least one connection to deal with */
/* do all the reads first, so we can detect closed sockets */