aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/buffers.c6
-rw-r--r--src/or/connection.c3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index afb302097..5cd1e0f9a 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -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) {
diff --git a/src/or/connection.c b/src/or/connection.c
index f56acdf24..225b92b24 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -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);