From: Philip Prindeville Date: Sat, 12 Nov 2016 00:51:37 +0000 (-0700) Subject: C90 doesn't like declarations intermingled with statements X-Git-Tag: release-2.1.8-stable~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bf2061c4bce52a802311d21540846d51d4bac35;p=libevent 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 --- 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; } diff --git a/test/bench_httpclient.c b/test/bench_httpclient.c index bcddc95f..e1592951 100644 --- a/test/bench_httpclient.c +++ b/test/bench_httpclient.c @@ -181,13 +181,14 @@ main(int argc, char **argv) struct timeval start, end, total; long long usec; double throughput; - resource = "/ref"; #ifdef _WIN32 WSADATA WSAData; WSAStartup(0x101, &WSAData); #endif + resource = "/ref"; + setvbuf(stdout, NULL, _IONBF, 0); base = event_base_new();