diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-26 23:00:07 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-26 23:00:07 +0000 |
commit | ad07c62938e6b905db5ca6468bb2c5f211300e5c (patch) | |
tree | ba393231ddb00e2e8eb0fbbbf4f2df6a08891447 /src/or/buffers.c | |
parent | e34c201bb3678891c425f8db615759003ff77649 (diff) | |
download | tor-ad07c62938e6b905db5ca6468bb2c5f211300e5c.tar.gz tor-ad07c62938e6b905db5ca6468bb2c5f211300e5c.zip |
Add a macro to catch unhandled openssl errors.
svn:r1723
Diffstat (limited to 'src/or/buffers.c')
-rw-r--r-- | src/or/buffers.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c index 4cf9b39624..8eca58818d 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -221,7 +221,7 @@ int read_to_buf_tls(tor_tls *tls, int at_most, buf_t *buf) { tor_tls_get_pending_bytes(tls), at_most); if (buf_ensure_capacity(buf, at_most+buf->datalen)) - return -1; + return TOR_TLS_ERROR; if (at_most > buf->len - buf->datalen) at_most = buf->len - buf->datalen; @@ -231,6 +231,8 @@ int read_to_buf_tls(tor_tls *tls, int at_most, buf_t *buf) { log_fn(LOG_DEBUG,"before: %d on buf, %d pending, at_most %d.",(int)buf_datalen(buf), tor_tls_get_pending_bytes(tls), at_most); + + assert_no_tls_errors(); r = tor_tls_read(tls, buf->mem+buf->datalen, at_most); if (r<0) return r; |