summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-02-28 11:48:22 +0000
committerRoger Dingledine <arma@torproject.org>2004-02-28 11:48:22 +0000
commit80410fa8dc1db2421c1b0b116ced2e52ecd8b705 (patch)
treea09cb6a79278029964463cd4c5e48d4d13958681
parentd1deb753db7805f2484bacd179af99d7c41a485d (diff)
downloadtor-80410fa8dc1db2421c1b0b116ced2e52ecd8b705.tar.gz
tor-80410fa8dc1db2421c1b0b116ced2e52ecd8b705.zip
some comments to point nick at the latest bugs
svn:r1162
-rw-r--r--src/or/connection.c3
-rw-r--r--src/or/main.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 8edfe8ed18..e4b99a4bfa 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -414,6 +414,9 @@ int connection_handle_read(connection_t *conn) {
router_mark_as_down(conn->nickname);
}
/* There's a read error; kill the connection.*/
+ /* XXX This is the place. We need to somehow indicate to
+ * conn that it should never try to flush, or do anything
+ * with conn->s but close it. */
connection_mark_for_close(conn, END_STREAM_REASON_MISC);
return -1;
}
diff --git a/src/or/main.c b/src/or/main.c
index 7bec18ab62..8e701341d3 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -181,6 +181,7 @@ static void conn_read(int i) {
if (!conn->marked_for_close) {
/* this connection is broken. remove it */
/* XXX This shouldn't ever happen anymore. */
+ /* XXX but it'll clearly happen on MS_WINDOWS from POLLERR, right? */
log_fn(LOG_ERR,"Unhandled error on read for %s connection (fd %d); removing",
conn_type_to_string[conn->type], conn->s);
connection_mark_for_close(conn,0);
@@ -220,8 +221,10 @@ static void conn_close_if_marked(int i) {
assert_connection_ok(conn, time(NULL));
if(conn->marked_for_close) {
log_fn(LOG_INFO,"Cleaning up connection (fd %d).",conn->s);
- if(conn->s >= 0) { /* might be an incomplete edge connection */
+ if(conn->s >= 0) { /* -1 means it's an incomplete edge connection */
/* FIXME there's got to be a better way to check for this -- and make other checks? */
+/* XXX the below two calls to flush_buf should not happen if the
+ * conn got hung up on. */
if(connection_speaks_cells(conn)) {
if(conn->state == OR_CONN_STATE_OPEN)
flush_buf_tls(conn->tls, conn->outbuf, &conn->outbuf_flushlen);