diff --git a/src/nghttp.cc b/src/nghttp.cc index 8211f096..01a7f025 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -586,8 +586,6 @@ struct HttpClient { } }; -extern bool ssl_debug; - namespace { void submit_request(HttpClient *client, const std::map& headers, @@ -861,13 +859,13 @@ int client_select_next_proto_cb(SSL* ssl, const unsigned char *in, unsigned int inlen, void *arg) { - if(ssl_debug) { + if(config.verbose) { print_timer(); std::cout << " NPN select next protocol: the remote server offers:" << std::endl; } for(unsigned int i = 0; i < inlen; i += in[i]+1) { - if(ssl_debug) { + if(config.verbose) { std::cout << " * "; std::cout.write(reinterpret_cast(&in[i+1]), in[i]); std::cout << std::endl; @@ -877,7 +875,7 @@ int client_select_next_proto_cb(SSL* ssl, std::cerr << "Server did not advertise HTTP/2.0 protocol." << std::endl; } else { - if(ssl_debug) { + if(config.verbose) { std::cout << " NPN selected the protocol: " << std::string((const char*)*out, (size_t)*outlen) << std::endl; @@ -1088,7 +1086,6 @@ int run(char **uris, int n) callbacks.on_unknown_frame_recv_callback = on_unknown_frame_recv_callback; } callbacks.on_data_chunk_recv_callback = on_data_chunk_recv_callback; - ssl_debug = config.verbose; std::string prev_host; uint16_t prev_port = 0; int failures = 0; diff --git a/src/nghttp2_ssl.cc b/src/nghttp2_ssl.cc index 51637e63..57dac029 100644 --- a/src/nghttp2_ssl.cc +++ b/src/nghttp2_ssl.cc @@ -48,37 +48,6 @@ namespace nghttp2 { -bool ssl_debug = false; - -int select_next_proto_cb(SSL* ssl, - unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, - void *arg) -{ - if(ssl_debug) { - print_timer(); - std::cout << " NPN select next protocol: the remote server offers:" - << std::endl; - } - for(unsigned int i = 0; i < inlen; i += in[i]+1) { - if(ssl_debug) { - std::cout << " * "; - std::cout.write(reinterpret_cast(&in[i+1]), in[i]); - std::cout << std::endl; - } - } - if(nghttp2_select_next_protocol(out, outlen, in, inlen) <= 0) { - std::cerr << "Server did not advertise HTTP/2.0 protocol." - << std::endl; - abort(); - } - if(ssl_debug) { - std::cout << " NPN selected the protocol: " - << std::string((const char*)*out, (size_t)*outlen) << std::endl; - } - return SSL_TLSEXT_ERR_OK; -} - namespace { const char* strstatus(nghttp2_error_code error_code) { diff --git a/src/nghttp2_ssl.h b/src/nghttp2_ssl.h index e31bef26..30f4d3b0 100644 --- a/src/nghttp2_ssl.h +++ b/src/nghttp2_ssl.h @@ -39,13 +39,6 @@ namespace nghttp2 { -extern bool ssl_debug; - -int select_next_proto_cb(SSL* ssl, - unsigned char **out, unsigned char *outlen, - const unsigned char *in, unsigned int inlen, - void *arg); - void print_nv(char **nv); void on_frame_recv_callback diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 9425b4da..3e8c0bd3 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -42,8 +42,6 @@ namespace nghttp2 { -extern bool ssl_debug; - namespace { void print_usage(std::ostream& out) { @@ -168,7 +166,6 @@ int main(int argc, char **argv) SSL_library_init(); reset_timer(); config.on_request_recv_callback = htdocs_on_request_recv_callback; - ssl_debug = config.verbose; HttpServer server(&config); server.run();