diff options
author | Roger Dingledine <arma@torproject.org> | 2003-11-12 05:12:51 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2003-11-12 05:12:51 +0000 |
commit | 4ba8bc0a73038c6a427c7e2e11ec74a7e429fa29 (patch) | |
tree | 713716c788fed6a50bc9d0b2cece8f234021d29b /src/or/connection_or.c | |
parent | 5e4b9c6b61cb5785594479b1d00938e87bb597c2 (diff) | |
download | tor-4ba8bc0a73038c6a427c7e2e11ec74a7e429fa29.tar tor-4ba8bc0a73038c6a427c7e2e11ec74a7e429fa29.tar.gz |
make dir parsing robust to invalid but well-formed descriptors
svn:r800
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index e768f13be..920b3319c 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -275,6 +275,7 @@ static int connection_or_process_cell_from_inbuf(connection_t *conn) { char buf[CELL_NETWORK_SIZE]; cell_t cell; +loop: log_fn(LOG_DEBUG,"%d: starting, inbuf_datalen %d (%d pending in tls object).", conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls)); if(buf_datalen(conn->inbuf) < CELL_NETWORK_SIZE) /* entire response available? */ @@ -282,14 +283,13 @@ static int connection_or_process_cell_from_inbuf(connection_t *conn) { connection_fetch_from_buf(buf, CELL_NETWORK_SIZE, conn); - /* retrieve cell info from buf (create the host-order struct from the network-order string) */ + /* retrieve cell info from buf (create the host-order struct from the + * network-order string) */ cell_unpack(&cell, buf); command_process_cell(&cell, conn); - /* CLEAR Shouldn't this be connection_or_process_inbuf at least? Or maybe - just use a loop? If not, doc why not. */ - return connection_process_inbuf(conn); /* process the remainder of the buffer */ + goto loop; /* process the remainder of the buffer */ } /* |