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
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;
}
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();