stop asserting that computers always go forward in time

it's simply not true


svn:r1236
This commit is contained in:
Roger Dingledine 2004-03-06 01:43:37 +00:00
parent 1e5b7bc6f1
commit 6c9d78b319
5 changed files with 8 additions and 5 deletions

View File

@ -870,10 +870,12 @@ void assert_connection_ok(connection_t *conn, time_t now)
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

View File

@ -154,8 +154,9 @@ int connection_tls_start_handshake(connection_t *conn, int receiving) {
}
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;
}

View File

@ -58,12 +58,12 @@ int connection_cpu_process_inbuf(connection_t *conn) {
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--;

View File

@ -353,7 +353,7 @@ int connection_dns_process_inbuf(connection_t *conn) {
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--;

View File

@ -247,7 +247,7 @@ static void conn_close_if_marked(int i) {
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);
}