In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "rgw built-in civweb parameter initialization how to achieve", in the daily operation, I believe many people in rgw built-in civweb parameter initialization how to achieve the problem there are doubts, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation methods, hope to answer "rgw built-in civweb parameter initialization how to achieve" doubts help! Next, please follow the small series to learn together!
1. Initialize parameter passing for a civweb moment
src/civetweb/civetweb.h
/* Start web server. Parameters: callbacks: mg_callbacks structure with user-defined callbacks. options: NULL terminated list of option_name, option_value pairs that specify Civetweb configuration parameters. Side-effects: on UNIX, ignores SIGCHLD and SIGPIPE signals. If custom processing is required for these, signal handlers must be set up after calling mg_start(). Example: const char *options[] = { "document_root", "/var/www", "listening_ports", "80,443s", NULL }; struct mg_context *ctx = mg_start(&my_func, NULL, options); Refer to https://github.com/bel2125/civetweb/blob/master/docs/UserManual.md for the list of valid option and their possible values. Return: web server context, or NULL on error. */CIVETWEB_API struct mg_context *mg_start(const struct mg_callbacks *callbacks, void *user_data, const char **configuration_options);
Parameter initialization at startup of civeweb is implemented by mg_start function. Note that configuration_options are specific configuration parameters.
2. initialization of parameters for civeweb startup in rgw
src/rgw/rgw_civetweb_frontend.cc
int RGWMongooseFrontend::run() { char thread_pool_buf[32]; snprintf(thread_pool_buf, sizeof(thread_pool_buf), "%d", (int)g_conf->rgw_thread_pool_size); string port_str; map conf_map = conf->get_config_map(); conf->get_val ("port", "80", &port_str); conf_map.erase("port"); conf_map["listening_ports"] = port_str; #default port settings set_conf_default (conf_map, "enable_keep_alive", "yes"); #keepalive set_conf_default is enabled by default (conf_map, "num_threads", thread_pool_buf); #Read the concurrency number from rgw_thread_pool_size set_conf_default(conf_map, "decode_url", "no"); // Set run_as_user. This will cause civetweb to invoke setuid() and setgid() // based on pw_uid and pw_gid obtained from pw_name. string uid_string = g_ceph_context->get_set_uid_string(); if (! uid_string.empty()) { conf_map.erase("run_as_user"); conf_map["run_as_user"] = uid_string; } const char *options[conf_map.size() * 2 + 1]; int i = 0; for (map::iterator iter = conf_map.begin(); iter != conf_map.end(); ++iter) { options[i] = iter->first.c_str(); options[i + 1] = iter->second.c_str(); dout(20)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.