src: Use C++ style comments for C++ source code

This commit is contained in:
Tatsuhiro Tsujikawa 2014-05-14 23:22:23 +09:00
parent 5b4f02dfe0
commit 2ae1da113e
15 changed files with 59 additions and 59 deletions

View File

@ -1725,7 +1725,7 @@ int HttpServer::run()
EC_KEY_free(ecdh); EC_KEY_free(ecdh);
#endif // OPENSSL_VERSION_NUBMER < 0x10002000L #endif // OPENSSL_VERSION_NUBMER < 0x10002000L
#endif /* OPENSSL_NO_EC */ #endif // OPENSSL_NO_EC
if(SSL_CTX_use_PrivateKey_file(ssl_ctx, if(SSL_CTX_use_PrivateKey_file(ssl_ctx,
config_->private_key_file.c_str(), config_->private_key_file.c_str(),

View File

@ -27,7 +27,7 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif /* HAVE_CONFIG_H */ #endif // HAVE_CONFIG_H
#include <jansson.h> #include <jansson.h>
@ -44,4 +44,4 @@ void output_json_header(void);
void output_json_footer(void); void output_json_footer(void);
#endif /* NGHTTP2_COMP_HELPER_H */ #endif // NGHTTP2_COMP_HELPER_H

View File

@ -24,7 +24,7 @@
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif /* HAVE_CONFIG_H */ #endif // HAVE_CONFIG_H
#include <unistd.h> #include <unistd.h>
#include <getopt.h> #include <getopt.h>
@ -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())); json_object_set_new(obj, "headers", dump_headers(nva.data(), nva.size()));
if(seq == 0) { 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_object_set_new(obj, "header_table_size",
json_integer(config.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'); for(val_end = val; *val_end && (*val_end != '\r' && *val_end != '\n');
++val_end); ++val_end);
*val_end = '\0'; *val_end = '\0';
/* printf("[%s] : [%s]\n", line, val); */
nv->namelen = strlen(line); nv->namelen = strlen(line);
nv->valuelen = strlen(val); nv->valuelen = strlen(val);
nv->name = (uint8_t*)strdup(line); nv->name = (uint8_t*)strdup(line);
@ -423,11 +423,11 @@ int main(int argc, char **argv)
print_help(); print_help();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 't': case 't':
/* --http1text */ // --http1text
config.http1text = 1; config.http1text = 1;
break; break;
case 's': case 's':
/* --table-size */ // --table-size
errno = 0; errno = 0;
config.table_size = strtoul(optarg, &end, 10); config.table_size = strtoul(optarg, &end, 10);
if(errno == ERANGE || *end != '\0') { if(errno == ERANGE || *end != '\0') {
@ -436,7 +436,7 @@ int main(int argc, char **argv)
} }
break; break;
case 'S': case 'S':
/* --deflate-table-size */ // --deflate-table-size
errno = 0; errno = 0;
config.deflate_table_size = strtoul(optarg, &end, 10); config.deflate_table_size = strtoul(optarg, &end, 10);
if(errno == ERANGE || *end != '\0') { if(errno == ERANGE || *end != '\0') {
@ -445,11 +445,11 @@ int main(int argc, char **argv)
} }
break; break;
case 'd': case 'd':
/* --dump-header-table */ // --dump-header-table
config.dump_header_table = 1; config.dump_header_table = 1;
break; break;
case 'c': case 'c':
/* --no-refset */ // --no-refset
config.no_refset = 1; config.no_refset = 1;
break; break;
case '?': case '?':

View File

@ -671,7 +671,7 @@ int main(int argc, char **argv)
"no threads created." << std::endl; "no threads created." << std::endl;
#else #else
config.nthreads = strtoul(optarg, nullptr, 10); config.nthreads = strtoul(optarg, nullptr, 10);
#endif /* NOTHREADS */ #endif // NOTHREADS
break; break;
case 'm': case 'm':
if(util::strieq("auto", optarg)) { if(util::strieq("auto", optarg)) {
@ -783,7 +783,7 @@ int main(int argc, char **argv)
#ifndef NOTHREADS #ifndef NOTHREADS
ssl::LibsslGlobalLock(); ssl::LibsslGlobalLock();
#endif /* NOTHREADS */ #endif // NOTHREADS
auto ssl_ctx = SSL_CTX_new(SSLv23_client_method()); auto ssl_ctx = SSL_CTX_new(SSLv23_client_method());
if(!ssl_ctx) { if(!ssl_ctx) {

View File

@ -24,7 +24,7 @@
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> # include <config.h>
#endif /* HAVE_CONFIG_H */ #endif // HAVE_CONFIG_H
#include <unistd.h> #include <unistd.h>
#include <getopt.h> #include <getopt.h>
@ -271,7 +271,7 @@ int main(int argc, char **argv)
print_help(); print_help();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case 'd': case 'd':
/* --dump-header-table */ // --dump-header-table
config.dump_header_table = 1; config.dump_header_table = 1;
break; break;
case '?': case '?':

View File

@ -991,14 +991,14 @@ int htp_msg_completecb(http_parser *htp)
namespace { namespace {
http_parser_settings htp_hooks = { http_parser_settings htp_hooks = {
htp_msg_begincb, /*http_cb on_message_begin;*/ htp_msg_begincb, // http_cb on_message_begin;
nullptr, /*http_data_cb on_url;*/ nullptr, // http_data_cb on_url;
htp_status_completecb, /*http_cb on_status_complete */ htp_status_completecb, // http_cb on_status_complete;
nullptr, /*http_data_cb on_header_field;*/ nullptr, // http_data_cb on_header_field;
nullptr, /*http_data_cb on_header_value;*/ nullptr, // http_data_cb on_header_value;
nullptr, /*http_cb on_headers_complete;*/ nullptr, // http_cb on_headers_complete;
nullptr, /*http_data_cb on_body;*/ nullptr, // http_data_cb on_body;
htp_msg_completecb /*http_cb on_message_complete;*/ htp_msg_completecb // http_cb on_message_complete;
}; };
} // namespace } // namespace

View File

@ -195,7 +195,7 @@ int main(int argc, char **argv)
std::cerr << "-n: Bad option value: " << optarg << std::endl; std::cerr << "-n: Bad option value: " << optarg << std::endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
#endif /* NOTHREADS */ #endif // NOTHREADS
break; break;
case 'h': case 'h':
print_help(std::cout); print_help(std::cout);
@ -278,7 +278,7 @@ int main(int argc, char **argv)
SSL_library_init(); SSL_library_init();
#ifndef NOTHREADS #ifndef NOTHREADS
ssl::LibsslGlobalLock(); ssl::LibsslGlobalLock();
#endif /* NOTHREADS */ #endif // NOTHREADS
reset_timer(); reset_timer();

View File

@ -27,7 +27,7 @@
#include <CUnit/Basic.h> #include <CUnit/Basic.h>
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
/* include test cases' include files here */ // include test cases' include files here
#include "shrpx_ssl_test.h" #include "shrpx_ssl_test.h"
#include "shrpx_downstream_test.h" #include "shrpx_downstream_test.h"
#include "shrpx_config_test.h" #include "shrpx_config_test.h"
@ -55,18 +55,18 @@ int main(int argc, char* argv[])
SSL_load_error_strings(); SSL_load_error_strings();
SSL_library_init(); SSL_library_init();
/* initialize the CUnit test registry */ // initialize the CUnit test registry
if (CUE_SUCCESS != CU_initialize_registry()) if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error(); 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); pSuite = CU_add_suite("shrpx_TestSuite", init_suite1, clean_suite1);
if (NULL == pSuite) { if (NULL == pSuite) {
CU_cleanup_registry(); CU_cleanup_registry();
return CU_get_error(); 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", if(!CU_add_test(pSuite, "ssl_create_lookup_tree",
shrpx::test_shrpx_ssl_create_lookup_tree) || shrpx::test_shrpx_ssl_create_lookup_tree) ||
!CU_add_test(pSuite, "ssl_cert_lookup_tree_add_cert_from_file", !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(); 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_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests(); CU_basic_run_tests();
num_tests_failed = CU_get_number_of_tests_failed(); num_tests_failed = CU_get_number_of_tests_failed();

View File

@ -913,7 +913,7 @@ int main(int argc, char **argv)
LOG(WARNING) << "Threading disabled at build time, no threads created."; LOG(WARNING) << "Threading disabled at build time, no threads created.";
#else #else
cmdcfgs.emplace_back(SHRPX_OPT_WORKERS, optarg); cmdcfgs.emplace_back(SHRPX_OPT_WORKERS, optarg);
#endif /* NOTHREADS */ #endif // NOTHREADS
break; break;
case 'o': case 'o':
cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_FRAME_DEBUG, "yes"); cmdcfgs.emplace_back(SHRPX_OPT_FRONTEND_FRAME_DEBUG, "yes");
@ -1161,7 +1161,7 @@ int main(int argc, char **argv)
SSL_library_init(); SSL_library_init();
#ifndef NOTHREADS #ifndef NOTHREADS
nghttp2::ssl::LibsslGlobalLock(); nghttp2::ssl::LibsslGlobalLock();
#endif /* NOTHREADS */ #endif // NOTHREADS
if(conf_exists(get_config()->conf_path)) { if(conf_exists(get_config()->conf_path)) {
if(load_config(get_config()->conf_path) == -1) { if(load_config(get_config()->conf_path) == -1) {

View File

@ -32,4 +32,4 @@ void test_shrpx_config_parse_header(void);
} // namespace shrpx } // namespace shrpx
#endif /* SHRPX_CONFIG_TEST_H */ #endif // SHRPX_CONFIG_TEST_H

View File

@ -527,14 +527,14 @@ int htp_hdrs_completecb(http_parser *htp)
namespace { namespace {
http_parser_settings htp_hooks = { http_parser_settings htp_hooks = {
nullptr, /*http_cb on_message_begin;*/ nullptr, // http_cb on_message_begin;
nullptr, /*http_data_cb on_url;*/ nullptr, // http_data_cb on_url;
nullptr, /*http_cb on_status_complete */ nullptr, // http_cb on_status_complete;
nullptr, /*http_data_cb on_header_field;*/ nullptr, // http_data_cb on_header_field;
nullptr, /*http_data_cb on_header_value;*/ nullptr, // http_data_cb on_header_value;
htp_hdrs_completecb, /*http_cb on_headers_complete;*/ htp_hdrs_completecb, // http_cb on_headers_complete;
nullptr, /*http_data_cb on_body;*/ nullptr, // http_data_cb on_body;
nullptr /*http_cb on_message_complete;*/ nullptr // http_cb on_message_complete;
}; };
} // namespace } // namespace

View File

@ -488,14 +488,14 @@ int htp_msg_completecb(http_parser *htp)
namespace { namespace {
http_parser_settings htp_hooks = { http_parser_settings htp_hooks = {
nullptr, /*http_cb on_message_begin;*/ nullptr, // http_cb on_message_begin;
nullptr, /*http_data_cb on_url;*/ nullptr, // http_data_cb on_url;
nullptr, /*http_cb on_status_complete */ nullptr, // http_cb on_status_complete;
htp_hdr_keycb, /*http_data_cb on_header_field;*/ htp_hdr_keycb, // http_data_cb on_header_field;
htp_hdr_valcb, /*http_data_cb on_header_value;*/ htp_hdr_valcb, // http_data_cb on_header_value;
htp_hdrs_completecb, /*http_cb on_headers_complete;*/ htp_hdrs_completecb, // http_cb on_headers_complete;
htp_bodycb, /*http_data_cb on_body;*/ htp_bodycb, // http_data_cb on_body;
htp_msg_completecb /*http_cb on_message_complete;*/ htp_msg_completecb // http_cb on_message_complete;
}; };
} // namespace } // namespace

View File

@ -246,14 +246,14 @@ int htp_msg_completecb(http_parser *htp)
namespace { namespace {
http_parser_settings htp_hooks = { http_parser_settings htp_hooks = {
htp_msg_begin, /*http_cb on_message_begin;*/ htp_msg_begin, // http_cb on_message_begin;
htp_uricb, /*http_data_cb on_url;*/ htp_uricb, // http_data_cb on_url;
nullptr, /*http_cb on_status_complete */ nullptr, // http_cb on_status_complete;
htp_hdr_keycb, /*http_data_cb on_header_field;*/ htp_hdr_keycb, // http_data_cb on_header_field;
htp_hdr_valcb, /*http_data_cb on_header_value;*/ htp_hdr_valcb, // http_data_cb on_header_value;
htp_hdrs_completecb, /*http_cb on_headers_complete;*/ htp_hdrs_completecb, // http_cb on_headers_complete;
htp_bodycb, /*http_data_cb on_body;*/ htp_bodycb, // http_data_cb on_body;
htp_msg_completecb /*http_cb on_message_complete;*/ htp_msg_completecb // http_cb on_message_complete;
}; };
} // namespace } // namespace

View File

@ -296,7 +296,7 @@ SSL_CTX* create_ssl_context(const char *private_key_file,
EC_KEY_free(ecdh); EC_KEY_free(ecdh);
#endif // OPENSSL_VERSION_NUBMER < 0x10002000L #endif // OPENSSL_VERSION_NUBMER < 0x10002000L
#endif /* OPENSSL_NO_EC */ #endif // OPENSSL_NO_EC
if(get_config()->dh_param_file) { if(get_config()->dh_param_file) {
// Read DH parameters from file // Read DH parameters from file

View File

@ -32,4 +32,4 @@ void test_shrpx_ssl_cert_lookup_tree_add_cert_from_file(void);
} // namespace shrpx } // namespace shrpx
#endif /* SHRPX_SSL_TEST_H */ #endif // SHRPX_SSL_TEST_H