aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-09-24 21:24:52 +0000
committerRoger Dingledine <arma@torproject.org>2003-09-24 21:24:52 +0000
commit40d0fca63ae25e9e98b70bd75ce356d63ebc6c45 (patch)
treef433623559193f89f01b6497a8462066d610495a /src/or/connection_or.c
parent36ec1792d250a9694273c12d832229e077e9bf76 (diff)
downloadtor-40d0fca63ae25e9e98b70bd75ce356d63ebc6c45.tar
tor-40d0fca63ae25e9e98b70bd75ce356d63ebc6c45.tar.gz
cleanups, bugfixes, more verbose logs
Fixed up the assert_*_ok funcs some (more work remains) Changed config so it reads either /etc/torrc or the -f arg, never both Finally tracked down a nasty bug with our use of tls: It turns out that if you ask SSL_read() for no more than n bytes, it will read the entire record from the network (and maybe part of the next record, I'm not sure), give you n bytes of it, and keep the remaining bytes internally. This is fine, except our poll-for-read looks at the network, and there are no bytes pending on the network, so we never know to ask SSL_read() for more bytes. Currently I've hacked it so if we ask for n bytes and it returns n bytes, then it reads again right then. This will interact poorly with our rate limiting; we need a cleaner solution. svn:r481
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index bdc859eea..026de91de 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -144,13 +144,12 @@ int connection_write_cell_to_buf(const cell_t *cellp, connection_t *conn) {
return connection_write_to_buf(n, CELL_NETWORK_SIZE, conn);
}
+/* if there's a whole cell there, pull it off and process it. */
int connection_process_cell_from_inbuf(connection_t *conn) {
- /* check if there's a whole cell there.
- * * if yes, pull it off, decrypt it if we're not doing TLS, and process it.
- * */
char buf[CELL_NETWORK_SIZE];
cell_t cell;
+ log_fn(LOG_DEBUG,"%d: starting, inbuf_datalen %d.",conn->s,conn->inbuf_datalen);
if(conn->inbuf_datalen < CELL_NETWORK_SIZE) /* entire response available? */
return 0; /* not yet */
@@ -159,7 +158,6 @@ int connection_process_cell_from_inbuf(connection_t *conn) {
/* retrieve cell info from buf (create the host-order struct from the network-order string) */
cell_unpack(&cell, buf);
-// log_fn(LOG_DEBUG,"Decrypted cell is of type %u (ACI %u).",cellp->command,cellp->aci);
command_process_cell(&cell, conn);
return connection_process_inbuf(conn); /* process the remainder of the buffer */