aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-04-10 15:12:24 +0000
committerNick Mathewson <nickm@torproject.org>2008-04-10 15:12:24 +0000
commitb927ede48c3785a14e15b855061aaffe8dc42810 (patch)
tree522111c11d630f0dce21b37e819bd3628ae0aa2a /src/common
parentc776da9537147d138e22785ca2564696b0439287 (diff)
downloadtor-b927ede48c3785a14e15b855061aaffe8dc42810.tar
tor-b927ede48c3785a14e15b855061aaffe8dc42810.tar.gz
r15161@31-33-107: nickm | 2008-04-10 11:11:58 -0400
Make dumpstats() log the size and fullness of openssl-internal buffers, so I can test my hypothesis that many of them are empty, and my alternative hypothesis that many of them are mostly empty, against the null hypothesis that we really need to be burning 32K per open OR connection on this. svn:r14350
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tortls.c11
-rw-r--r--src/common/tortls.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 07cf17bc1..33666166b 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1346,3 +1346,14 @@ tor_tls_used_v1_handshake(tor_tls_t *tls)
return 1;
}
+/** DOCDOC */
+void
+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;
+ *rbuf_bytes = tls->ssl->s3->rbuf.left;
+ *wbuf_bytes = tls->ssl->s3->wbuf.left;
+}
diff --git a/src/common/tortls.h b/src/common/tortls.h
index 52c8350fe..211c8255b 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -73,6 +73,10 @@ size_t tor_tls_get_forced_write_size(tor_tls_t *tls);
void tor_tls_get_n_raw_bytes(tor_tls_t *tls,
size_t *n_read, size_t *n_written);
+void tor_tls_get_buffer_sizes(tor_tls_t *tls,
+ int *rbuf_capacity, int *rbuf_bytes,
+ int *wbuf_capacity, int *wbuf_bytes);
+
int tor_tls_used_v1_handshake(tor_tls_t *tls);
/* Log and abort if there are unhandled TLS errors in OpenSSL's error stack.