[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] stop asserting that computers always go forward in time



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection.c connection_or.c cpuworker.c dns.c main.c 
Log Message:
stop asserting that computers always go forward in time
it's simply not true


Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -d -r1.175 -r1.176
--- connection.c	3 Mar 2004 22:49:15 -0000	1.175
+++ connection.c	6 Mar 2004 01:43:37 -0000	1.176
@@ -870,10 +870,12 @@
     assert_buf_ok(conn->outbuf);
   }
 
+#if 0 /* computers often go back in time; no way to know */
   assert(!now || conn->timestamp_lastread <= now);
   assert(!now || conn->timestamp_lastwritten <= now);
   assert(conn->timestamp_created <= conn->timestamp_lastread);
   assert(conn->timestamp_created <= conn->timestamp_lastwritten);
+#endif
 
   /* XXX Fix this; no longer so.*/
 #if 0

Index: connection_or.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_or.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- connection_or.c	3 Mar 2004 06:26:34 -0000	1.85
+++ connection_or.c	6 Mar 2004 01:43:37 -0000	1.86
@@ -154,8 +154,9 @@
   }
   connection_start_reading(conn);
   log_fn(LOG_DEBUG,"starting the handshake");
-  if(connection_tls_continue_handshake(conn) < 0)
+  if(connection_tls_continue_handshake(conn) < 0) {
     return -1;
+  }
   return 0;
 }
 

Index: cpuworker.c
===================================================================
RCS file: /home/or/cvsroot/src/or/cpuworker.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cpuworker.c	4 Mar 2004 21:26:23 -0000	1.24
+++ cpuworker.c	6 Mar 2004 01:43:37 -0000	1.25
@@ -58,12 +58,12 @@
   assert(conn && conn->type == CONN_TYPE_CPUWORKER);
 
   if(conn->inbuf_reached_eof) {
-    log_fn(LOG_WARN,"Read eof. Worker has died.");
+    log_fn(LOG_WARN,"Read eof. Worker died unexpectedly.");
     if(conn->state != CPUWORKER_STATE_IDLE) {
       /* the circ associated with this cpuworker will have to wait until
        * it gets culled in run_connection_housekeeping(), since we have
        * no way to find out which circ it was. */
-      log_fn(LOG_WARN,"...and leaving a circuit waiting. Oh well.");
+      log_fn(LOG_WARN,"...and it left a circuit queued; abandoning circ.");
       num_cpuworkers_busy--;
     }
     num_cpuworkers--;

Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dns.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- dns.c	4 Mar 2004 21:26:23 -0000	1.63
+++ dns.c	6 Mar 2004 01:43:37 -0000	1.64
@@ -353,7 +353,7 @@
   assert(conn && conn->type == CONN_TYPE_DNSWORKER);
 
   if(conn->inbuf_reached_eof) {
-    log_fn(LOG_WARN,"Read eof. Worker dying.");
+    log_fn(LOG_WARN,"Read eof. Worker died unexpectedly.");
     if(conn->state == DNSWORKER_STATE_BUSY) {
       dns_cancel_pending_resolve(conn->address);
       num_dnsworkers_busy--;

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -d -r1.192 -r1.193
--- main.c	3 Mar 2004 08:48:32 -0000	1.192
+++ main.c	6 Mar 2004 01:43:37 -0000	1.193
@@ -247,7 +247,7 @@
         retval = flush_buf_tls(conn->tls, conn->outbuf, &conn->outbuf_flushlen);
         /* XXX actually, some non-zero results are maybe ok. which ones? */
       } else
-        retval = -1;
+        retval = -1; /* never flush non-open broken tls connections */
     } else {
       retval = flush_buf(conn->s, conn->outbuf, &conn->outbuf_flushlen);
     }