]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
add a debugging entry, to find the wants-to-read-but-can't bug
authorRoger Dingledine <arma@torproject.org>
Mon, 26 Apr 2004 21:15:06 +0000 (21:15 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 26 Apr 2004 21:15:06 +0000 (21:15 +0000)
svn:r1719

src/or/buffers.c
src/or/connection.c

index afb30209701a9cc355919d0f14db2a49039c4a08..5cd1e0f9a73f9d828577fe04724d3660ca639bc4 100644 (file)
@@ -385,8 +385,10 @@ int fetch_from_buf_http(buf_t *buf,
       log_fn(LOG_DEBUG,"body not all here yet.");
       return 0; /* not all there yet */
     }
-    bodylen = contentlen;
-    log_fn(LOG_DEBUG,"bodylen reduced to %d.",bodylen);
+    if(bodylen > contentlen) {
+      bodylen = contentlen;
+      log_fn(LOG_DEBUG,"bodylen reduced to %d.",bodylen);
+    }
   }
   /* all happy. copy into the appropriate places, and return 1 */
   if(headers_out) {
index f56acdf244481dab6e1ff1a34ba53f70ae03bdca..225b92b247656900e1e3297ad7fd462ba853795c 100644 (file)
@@ -628,6 +628,9 @@ int connection_read_to_buf(connection_t *conn) {
       return connection_tls_continue_handshake(conn);
     }
 
+    log_fn(LOG_DEBUG,"%d: starting, inbuf_datalen %d (%d pending in tls object). at_most %d.",
+           conn->s,(int)buf_datalen(conn->inbuf),tor_tls_get_pending_bytes(conn->tls), at_most);
+
     /* else open, or closing */
     result = read_to_buf_tls(conn->tls, at_most, conn->inbuf);