From 1823c45a71e6898280248980f3863c0b6fa84de5 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 5 May 2008 23:57:17 +0000 Subject: [PATCH] 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 --- src/common/tortls.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/tortls.c b/src/common/tortls.c index dd7b885e2b..48a139394d 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; }