diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-03 09:37:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-03 09:37:44 -0400 |
commit | 1eef543f9d9cde9754897047fb51ac7307b9827a (patch) | |
tree | 7f2688ef58366f25e7cda78d96125efd4f140e69 /src/common/tortls.c | |
parent | 32854aef28f5ff94fc60647c9881576141574aba (diff) | |
parent | 464783a8dcc337c103801b8c551d1331baec1e9c (diff) | |
download | tor-1eef543f9d9cde9754897047fb51ac7307b9827a.tar.gz tor-1eef543f9d9cde9754897047fb51ac7307b9827a.zip |
Merge branch 'bug20551_028'
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 318dfc8dca..2efb3baa73 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -1647,8 +1647,8 @@ tor_tls_new(int sock, int isServer) result->state = TOR_TLS_ST_HANDSHAKE; result->isServer = isServer; result->wantwrite_n = 0; - result->last_write_count = BIO_number_written(bio); - result->last_read_count = BIO_number_read(bio); + result->last_write_count = (unsigned long) BIO_number_written(bio); + result->last_read_count = (unsigned long) BIO_number_read(bio); if (result->last_write_count || result->last_read_count) { log_warn(LD_NET, "Newly created BIO has read count %lu, write count %lu", result->last_read_count, result->last_write_count); @@ -2263,7 +2263,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, size_t *n_written) { BIO *wbio, *tmpbio; unsigned long r, w; - r = BIO_number_read(SSL_get_rbio(tls->ssl)); + r = (unsigned long) BIO_number_read(SSL_get_rbio(tls->ssl)); /* We want the number of bytes actually for real written. Unfortunately, * sometimes OpenSSL replaces the wbio on tls->ssl with a buffering bio, * which makes the answer turn out wrong. Let's cope with that. Note @@ -2284,7 +2284,7 @@ tor_tls_get_n_raw_bytes(tor_tls_t *tls, size_t *n_read, size_t *n_written) if (wbio->method == BIO_f_buffer() && (tmpbio = BIO_next(wbio)) != NULL) wbio = tmpbio; #endif - w = BIO_number_written(wbio); + w = (unsigned long) BIO_number_written(wbio); /* We are ok with letting these unsigned ints go "negative" here: * If we wrapped around, this should still give us the right answer, unless |