aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-05-05 23:57:17 +0000
committerNick Mathewson <nickm@torproject.org>2008-05-05 23:57:17 +0000
commit1823c45a71e6898280248980f3863c0b6fa84de5 (patch)
tree6d9bc5398ad1eabf354b0387f6fc32895de4238a
parentdb874621f475be4891883648463ff7e496cf3763 (diff)
downloadtor-1823c45a71e6898280248980f3863c0b6fa84de5.tar
tor-1823c45a71e6898280248980f3863c0b6fa84de5.tar.gz
r19613@catbus: nickm | 2008-05-05 19:57:06 -0400
Log correct openssl buf capacity when using my sooper sekrit buffer hack. This will help test the aforementioned ssbh. svn:r14567
-rw-r--r--src/common/tortls.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index dd7b885e2..48a139394 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1352,8 +1352,14 @@ tor_tls_get_buffer_sizes(tor_tls_t *tls,
int *rbuf_capacity, int *rbuf_bytes,
int *wbuf_capacity, int *wbuf_bytes)
{
- *rbuf_capacity = tls->ssl->s3->rbuf.len;
- *wbuf_capacity = tls->ssl->s3->wbuf.len;
+ if (tls->ssl->s3->rbuf.buf)
+ *rbuf_capacity = tls->ssl->s3->rbuf.len;
+ else
+ *rbuf_capacity = 0;
+ if (tls->ssl->s3->wbuf.buf)
+ *wbuf_capacity = tls->ssl->s3->wbuf.len;
+ else
+ *wbuf_capacity = 0;
*rbuf_bytes = tls->ssl->s3->rbuf.left;
*wbuf_bytes = tls->ssl->s3->wbuf.left;
}