diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 3e662e93..c1022c38 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -1725,7 +1725,7 @@ int HttpServer::run() EC_KEY_free(ecdh); #endif // OPENSSL_VERSION_NUBMER < 0x10002000L -#endif /* OPENSSL_NO_EC */ +#endif // OPENSSL_NO_EC if(SSL_CTX_use_PrivateKey_file(ssl_ctx, config_->private_key_file.c_str(), diff --git a/src/comp_helper.h b/src/comp_helper.h index d5db2e27..4afb1e82 100644 --- a/src/comp_helper.h +++ b/src/comp_helper.h @@ -27,7 +27,7 @@ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif // HAVE_CONFIG_H #include @@ -44,4 +44,4 @@ void output_json_header(void); void output_json_footer(void); -#endif /* NGHTTP2_COMP_HELPER_H */ +#endif // NGHTTP2_COMP_HELPER_H diff --git a/src/deflatehd.cc b/src/deflatehd.cc index 4f036d18..5081910a 100644 --- a/src/deflatehd.cc +++ b/src/deflatehd.cc @@ -24,7 +24,7 @@ */ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif // HAVE_CONFIG_H #include #include @@ -108,7 +108,7 @@ static void output_to_json(nghttp2_hd_deflater *deflater, } json_object_set_new(obj, "headers", dump_headers(nva.data(), nva.size())); if(seq == 0) { - /* We only change the header table size only once at the beginning */ + // We only change the header table size only once at the beginning json_object_set_new(obj, "header_table_size", json_integer(config.table_size)); } @@ -293,7 +293,7 @@ static int perform_from_http1text(void) for(val_end = val; *val_end && (*val_end != '\r' && *val_end != '\n'); ++val_end); *val_end = '\0'; - /* printf("[%s] : [%s]\n", line, val); */ + nv->namelen = strlen(line); nv->valuelen = strlen(val); nv->name = (uint8_t*)strdup(line); @@ -423,11 +423,11 @@ int main(int argc, char **argv) print_help(); exit(EXIT_SUCCESS); case 't': - /* --http1text */ + // --http1text config.http1text = 1; break; case 's': - /* --table-size */ + // --table-size errno = 0; config.table_size = strtoul(optarg, &end, 10); if(errno == ERANGE || *end != '\0') { @@ -436,7 +436,7 @@ int main(int argc, char **argv) } break; case 'S': - /* --deflate-table-size */ + // --deflate-table-size errno = 0; config.deflate_table_size = strtoul(optarg, &end, 10); if(errno == ERANGE || *end != '\0') { @@ -445,11 +445,11 @@ int main(int argc, char **argv) } break; case 'd': - /* --dump-header-table */ + // --dump-header-table config.dump_header_table = 1; break; case 'c': - /* --no-refset */ + // --no-refset config.no_refset = 1; break; case '?': diff --git a/src/h2load.cc b/src/h2load.cc index 73627cad..a2f96e5b 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -671,7 +671,7 @@ int main(int argc, char **argv) "no threads created." << std::endl; #else config.nthreads = strtoul(optarg, nullptr, 10); -#endif /* NOTHREADS */ +#endif // NOTHREADS break; case 'm': if(util::strieq("auto", optarg)) { @@ -783,7 +783,7 @@ int main(int argc, char **argv) #ifndef NOTHREADS ssl::LibsslGlobalLock(); -#endif /* NOTHREADS */ +#endif // NOTHREADS auto ssl_ctx = SSL_CTX_new(SSLv23_client_method()); if(!ssl_ctx) { diff --git a/src/inflatehd.cc b/src/inflatehd.cc index 1d36be6e..6f48ae00 100644 --- a/src/inflatehd.cc +++ b/src/inflatehd.cc @@ -24,7 +24,7 @@ */ #ifdef HAVE_CONFIG_H # include -#endif /* HAVE_CONFIG_H */ +#endif // HAVE_CONFIG_H #include #include @@ -271,7 +271,7 @@ int main(int argc, char **argv) print_help(); exit(EXIT_SUCCESS); case 'd': - /* --dump-header-table */ + // --dump-header-table config.dump_header_table = 1; break; case '?': diff --git a/src/nghttp.cc b/src/nghttp.cc index 2a467e13..0e17d197 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -991,14 +991,14 @@ int htp_msg_completecb(http_parser *htp) namespace { http_parser_settings htp_hooks = { - htp_msg_begincb, /*http_cb on_message_begin;*/ - nullptr, /*http_data_cb on_url;*/ - htp_status_completecb, /*http_cb on_status_complete */ - nullptr, /*http_data_cb on_header_field;*/ - nullptr, /*http_data_cb on_header_value;*/ - nullptr, /*http_cb on_headers_complete;*/ - nullptr, /*http_data_cb on_body;*/ - htp_msg_completecb /*http_cb on_message_complete;*/ + htp_msg_begincb, // http_cb on_message_begin; + nullptr, // http_data_cb on_url; + htp_status_completecb, // http_cb on_status_complete; + nullptr, // http_data_cb on_header_field; + nullptr, // http_data_cb on_header_value; + nullptr, // http_cb on_headers_complete; + nullptr, // http_data_cb on_body; + htp_msg_completecb // http_cb on_message_complete; }; } // namespace diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 9e471c28..b6ef4ff2 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -195,7 +195,7 @@ int main(int argc, char **argv) std::cerr << "-n: Bad option value: " << optarg << std::endl; exit(EXIT_FAILURE); } -#endif /* NOTHREADS */ +#endif // NOTHREADS break; case 'h': print_help(std::cout); @@ -278,7 +278,7 @@ int main(int argc, char **argv) SSL_library_init(); #ifndef NOTHREADS ssl::LibsslGlobalLock(); -#endif /* NOTHREADS */ +#endif // NOTHREADS reset_timer(); diff --git a/src/shrpx-unittest.cc b/src/shrpx-unittest.cc index 0a6c16fc..6015ad4b 100644 --- a/src/shrpx-unittest.cc +++ b/src/shrpx-unittest.cc @@ -27,7 +27,7 @@ #include #include #include -/* include test cases' include files here */ +// include test cases' include files here #include "shrpx_ssl_test.h" #include "shrpx_downstream_test.h" #include "shrpx_config_test.h" @@ -55,18 +55,18 @@ int main(int argc, char* argv[]) SSL_load_error_strings(); SSL_library_init(); - /* initialize the CUnit test registry */ + // initialize the CUnit test registry if (CUE_SUCCESS != CU_initialize_registry()) return CU_get_error(); - /* add a suite to the registry */ + // add a suite to the registry pSuite = CU_add_suite("shrpx_TestSuite", init_suite1, clean_suite1); if (NULL == pSuite) { CU_cleanup_registry(); return CU_get_error(); } - /* add the tests to the suite */ + // add the tests to the suite if(!CU_add_test(pSuite, "ssl_create_lookup_tree", shrpx::test_shrpx_ssl_create_lookup_tree) || !CU_add_test(pSuite, "ssl_cert_lookup_tree_add_cert_from_file", @@ -124,7 +124,7 @@ int main(int argc, char* argv[]) return CU_get_error(); } - /* Run all tests using the CUnit Basic interface */ + // Run all tests using the CUnit Basic interface CU_basic_set_mode(CU_BRM_VERBOSE); CU_basic_run_tests(); num_tests_failed = CU_get_number_of_tests_failed(); diff --git a/src/shrpx.cc b/src/shrpx.cc index b9a910f0..6d752043 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -913,7 +913,7 @@ int main(int argc, char **argv) LOG(WARNING) << "Threading disabled at build time, no threads created."; #else cmdcfgs.emplace_back(SHRPX_OPT_WORKERS, optarg); -#endif /* NOTHREADS */ +#endif // NOTHREADS break; case 'o': cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_FRAME_DEBUG, "yes"); @@ -1161,7 +1161,7 @@ int main(int argc, char **argv) SSL_library_init(); #ifndef NOTHREADS nghttp2::ssl::LibsslGlobalLock(); -#endif /* NOTHREADS */ +#endif // NOTHREADS if(conf_exists(get_config()->conf_path)) { if(load_config(get_config()->conf_path) == -1) { diff --git a/src/shrpx_config_test.h b/src/shrpx_config_test.h index 50f2b347..6b915766 100644 --- a/src/shrpx_config_test.h +++ b/src/shrpx_config_test.h @@ -32,4 +32,4 @@ void test_shrpx_config_parse_header(void); } // namespace shrpx -#endif /* SHRPX_CONFIG_TEST_H */ +#endif // SHRPX_CONFIG_TEST_H diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 0f52a7f0..1382839b 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -527,14 +527,14 @@ int htp_hdrs_completecb(http_parser *htp) namespace { http_parser_settings htp_hooks = { - nullptr, /*http_cb on_message_begin;*/ - nullptr, /*http_data_cb on_url;*/ - nullptr, /*http_cb on_status_complete */ - nullptr, /*http_data_cb on_header_field;*/ - nullptr, /*http_data_cb on_header_value;*/ - htp_hdrs_completecb, /*http_cb on_headers_complete;*/ - nullptr, /*http_data_cb on_body;*/ - nullptr /*http_cb on_message_complete;*/ + nullptr, // http_cb on_message_begin; + nullptr, // http_data_cb on_url; + nullptr, // http_cb on_status_complete; + nullptr, // http_data_cb on_header_field; + nullptr, // http_data_cb on_header_value; + htp_hdrs_completecb, // http_cb on_headers_complete; + nullptr, // http_data_cb on_body; + nullptr // http_cb on_message_complete; }; } // namespace diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index 4a895bff..a343df69 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -488,14 +488,14 @@ int htp_msg_completecb(http_parser *htp) namespace { http_parser_settings htp_hooks = { - nullptr, /*http_cb on_message_begin;*/ - nullptr, /*http_data_cb on_url;*/ - nullptr, /*http_cb on_status_complete */ - htp_hdr_keycb, /*http_data_cb on_header_field;*/ - htp_hdr_valcb, /*http_data_cb on_header_value;*/ - htp_hdrs_completecb, /*http_cb on_headers_complete;*/ - htp_bodycb, /*http_data_cb on_body;*/ - htp_msg_completecb /*http_cb on_message_complete;*/ + nullptr, // http_cb on_message_begin; + nullptr, // http_data_cb on_url; + nullptr, // http_cb on_status_complete; + htp_hdr_keycb, // http_data_cb on_header_field; + htp_hdr_valcb, // http_data_cb on_header_value; + htp_hdrs_completecb, // http_cb on_headers_complete; + htp_bodycb, // http_data_cb on_body; + htp_msg_completecb // http_cb on_message_complete; }; } // namespace diff --git a/src/shrpx_https_upstream.cc b/src/shrpx_https_upstream.cc index 6a00f3be..13c09cc5 100644 --- a/src/shrpx_https_upstream.cc +++ b/src/shrpx_https_upstream.cc @@ -246,14 +246,14 @@ int htp_msg_completecb(http_parser *htp) namespace { http_parser_settings htp_hooks = { - htp_msg_begin, /*http_cb on_message_begin;*/ - htp_uricb, /*http_data_cb on_url;*/ - nullptr, /*http_cb on_status_complete */ - htp_hdr_keycb, /*http_data_cb on_header_field;*/ - htp_hdr_valcb, /*http_data_cb on_header_value;*/ - htp_hdrs_completecb, /*http_cb on_headers_complete;*/ - htp_bodycb, /*http_data_cb on_body;*/ - htp_msg_completecb /*http_cb on_message_complete;*/ + htp_msg_begin, // http_cb on_message_begin; + htp_uricb, // http_data_cb on_url; + nullptr, // http_cb on_status_complete; + htp_hdr_keycb, // http_data_cb on_header_field; + htp_hdr_valcb, // http_data_cb on_header_value; + htp_hdrs_completecb, // http_cb on_headers_complete; + htp_bodycb, // http_data_cb on_body; + htp_msg_completecb // http_cb on_message_complete; }; } // namespace diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index 7bc2723e..40b5e110 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -296,7 +296,7 @@ SSL_CTX* create_ssl_context(const char *private_key_file, EC_KEY_free(ecdh); #endif // OPENSSL_VERSION_NUBMER < 0x10002000L -#endif /* OPENSSL_NO_EC */ +#endif // OPENSSL_NO_EC if(get_config()->dh_param_file) { // Read DH parameters from file diff --git a/src/shrpx_ssl_test.h b/src/shrpx_ssl_test.h index b0ac8ca6..fbb1fa62 100644 --- a/src/shrpx_ssl_test.h +++ b/src/shrpx_ssl_test.h @@ -32,4 +32,4 @@ void test_shrpx_ssl_cert_lookup_tree_add_cert_from_file(void); } // namespace shrpx -#endif /* SHRPX_SSL_TEST_H */ +#endif // SHRPX_SSL_TEST_H