src: Use C++ style comments for C++ source code
This commit is contained in:
parent
5b4f02dfe0
commit
2ae1da113e
|
@ -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(),
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#include <jansson.h>
|
||||
|
||||
|
@ -44,4 +44,4 @@ void output_json_header(void);
|
|||
|
||||
void output_json_footer(void);
|
||||
|
||||
#endif /* NGHTTP2_COMP_HELPER_H */
|
||||
#endif // NGHTTP2_COMP_HELPER_H
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#include <unistd.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()));
|
||||
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 '?':
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
#endif // HAVE_CONFIG_H
|
||||
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
|
@ -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 '?':
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <CUnit/Basic.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
/* 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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -32,4 +32,4 @@ void test_shrpx_config_parse_header(void);
|
|||
|
||||
} // namespace shrpx
|
||||
|
||||
#endif /* SHRPX_CONFIG_TEST_H */
|
||||
#endif // SHRPX_CONFIG_TEST_H
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue