summaryrefslogtreecommitdiff
path: root/bufferevent_openssl.c
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2016-11-11 17:51:37 -0700
committerAzat Khuzhin <a3at.mail@gmail.com>2016-12-06 09:56:28 +0300
commit6bf2061c4bce52a802311d21540846d51d4bac35 (patch)
tree2c67b374616b8b6f1e28ee29df6d913d7d4bdd34 /bufferevent_openssl.c
parentca591c5b1b8c4506c258a96e1fd5d8dafdb6234f (diff)
downloadlibevent-6bf2061c4bce52a802311d21540846d51d4bac35.tar.gz
C90 doesn't like declarations intermingled with statements
So move all of the declarations to the top of the offending function. This patch includes both of issues (Fixes:), from @jeking3 and @pprindeville Fixes: #418 Fixes: nmathewson/Libevent#136
Diffstat (limited to 'bufferevent_openssl.c')
-rw-r--r--bufferevent_openssl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c
index 2703d704..87225ca1 100644
--- a/bufferevent_openssl.c
+++ b/bufferevent_openssl.c
@@ -540,9 +540,11 @@ conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret)
static void
init_bio_counts(struct bufferevent_openssl *bev_ssl)
{
- BIO *wbio = SSL_get_wbio(bev_ssl->ssl);
+ BIO *rbio, *wbio;
+
+ wbio = SSL_get_wbio(bev_ssl->ssl);
bev_ssl->counts.n_written = wbio ? BIO_number_written(wbio) : 0;
- BIO *rbio = SSL_get_rbio(bev_ssl->ssl);
+ rbio = SSL_get_rbio(bev_ssl->ssl);
bev_ssl->counts.n_read = rbio ? BIO_number_read(rbio) : 0;
}