| /lighttpd1.4/src/ |
| H A D | server.c | 341 server *srv = ck_calloc(1, sizeof(*srv)); in server_init() local 843 srv->srv_sockets.ptr[i]->srv = srv; /* update ptr */ in server_sockets_restore() 847 srv->srv_sockets_inherited.ptr[i]->srv = srv; /* update ptr */ in server_sockets_restore() 1097 if (srv->cur_fds < srv->max_fds_lowat && 0 != srv->lim_conns) in server_overload_check() 1103 if (srv->cur_fds > srv->max_fds_hiwat || 0 == srv->lim_conns) in server_load_check() 1746 srv->max_fds = (int)srv->srvconf.max_fds; in server_main_setup() 1749 srv->ev = fdevent_init(srv->srvconf.event_handler, &srv->max_fds, &srv->cur_fds, srv->errh); in server_main_setup() 1763 srv->srvconf.max_conns, srv->max_fds); in server_main_setup() 1764 srv->lim_conns = srv->srvconf.max_conns = srv->max_fds/2; in server_main_setup() 1767 srv->lim_conns = srv->srvconf.max_conns; in server_main_setup() [all …]
|
| H A D | configfile.c | 1297 if (srv->srvconf.config_unsupported || srv->srvconf.config_deprecated) { in config_finalize() 1566 if (NULL == srv->match_data) pcre2_match_data_free(srv->match_data); in config_free() 1574 srv->srvconf.port = 0; in config_init() 1688 force_assert(srv->errh); in config_log_error_open() 1746 config_log_error_open_syslog(srv, srv->errh, in config_log_error_open() 1748 else if (srv->errh->mode == FDLOG_FD && !srv->srvconf.dont_daemonize) in config_log_error_open() 1749 srv->errh->fd = -1; in config_log_error_open() 2134 t.errh = srv->errh; in config_parse() 2440 context->srv = srv; in context_init() 2515 srv->config_context->data[j] = srv->config_context->data[i]; in config_read() [all …]
|
| H A D | network.c | 48 server * const srv = srv_socket->srv; in network_server_handle_fdevent() local 58 int loops = (int)srv->lim_conns; in network_server_handle_fdevent() 444 srv_socket->srv = srv; in network_server_init() 521 srv->cur_fds = srv_socket->fd; in network_server_init() 597 int network_close(server *srv) { in network_close() argument 610 free(srv->srv_sockets.ptr); in network_close() 611 srv->srv_sockets.ptr = NULL; in network_close() 612 srv->srv_sockets.used = 0; in network_close() 689 srv->srv_sockets.ptr[srv->srv_sockets.used-1]->sidx = (unsigned short)~0u; in network_socket_activation_nfds() 692 memcpy(&srv->srv_sockets_inherited, &srv->srv_sockets, sizeof(server_socket_array)); in network_socket_activation_nfds() [all …]
|
| H A D | plugin.c | 125 int plugins_load(server *srv) { in plugins_load() argument 142 ((plugin **)srv->plugins.ptr)[srv->plugins.used++] = p; in plugins_load() 161 int plugins_load(server *srv) { in plugins_load() argument 246 ((plugin **)srv->plugins.ptr)[srv->plugins.used++] = p; in plugins_load() 579 if (srv->plugin_slots) { in plugins_free() 580 plugins_call_cleanup(srv); in plugins_free() 581 free(srv->plugin_slots); in plugins_free() 582 srv->plugin_slots = NULL; in plugins_free() 588 free(srv->plugins.ptr); in plugins_free() 589 srv->plugins.ptr = NULL; in plugins_free() [all …]
|
| H A D | mod_rrdtool.c | 42 server *srv; member 68 if (NULL == p->srv) return; in FREE_FUNC() 116 p->srv_pid = srv->pid; in mod_rrd_create_pipe() 119 log_perror(srv->errh, __FILE__, __LINE__, in mod_rrd_create_pipe() 175 p->srv = srv; in SETDEFAULTS_FUNC() 264 log_error(srv->errh, __FILE__, __LINE__, in mod_rrdtool_create_rrd() 276 buffer * const cmd = srv->tmp_buf; in mod_rrdtool_create_rrd() 310 log_error(srv->errh, __FILE__, __LINE__, in mod_rrdtool_create_rrd() 332 buffer * const cmd = srv->tmp_buf; in mod_rrd_write_data() 363 log_error(srv->errh, __FILE__, __LINE__, in mod_rrd_write_data() [all …]
|
| H A D | plugin_config.h | 55 int config_capture(server *srv, int idx); 58 void config_init(server *srv); 61 void config_print(server *srv); 64 int config_read(server *srv, const char *fn); 67 int config_set_defaults(server *srv); 70 int config_finalize(server *srv, const buffer *default_server_tag); 73 void config_free(server *srv); 76 int config_log_error_open(server *srv); 79 void config_log_error_close(server *srv); 188 int config_feature_bool (const server *srv, const char *feature, int default_value); [all …]
|
| H A D | mod_status.c | 401 ts = cur_ts - srv->startup_ts; in mod_status_handle_server_status_html() 432 ts = srv->startup_ts; in mod_status_handle_server_status_html() 479 buffer_append_int(b, srv->srvconf.max_conns - srv->lim_conns); in mod_status_handle_server_status_html() 483 char *s = buffer_extend(b, srv->srvconf.max_conns - srv->lim_conns in mod_status_handle_server_status_html() 484 +(srv->srvconf.max_conns - srv->lim_conns)/50); in mod_status_handle_server_status_html() 533 mod_status_html_rtable(r, srv, cur_ts); in mod_status_handle_server_status_html() 561 buffer_append_int(b, srv->srvconf.max_conns - srv->lim_conns); in mod_status_handle_server_status_text() 571 s += srv->lim_conns; in mod_status_handle_server_status_text() 612 buffer_append_int(b, srv->srvconf.max_conns - srv->lim_conns); in mod_status_handle_server_status_json() 680 server * const srv = r->con->srv; in mod_status_handle_server_status() local [all …]
|
| H A D | reqpool.c | 57 r->tmp_buf = srv->tmp_buf; in request_init_data() 64 r->plugin_ctx = ck_calloc(srv->plugins.used + 1, sizeof(void *)); in request_init_data() 68 if (srv->config_captures) { in request_init_data() 69 r->cond_captures = srv->config_captures; in request_init_data() 71 r->cond_match_data = ck_calloc(srv->config_captures, in request_init_data() 160 plugin *p = ((plugin **)(srv->plugins.ptr))[i]; 180 server * const srv = con->srv; in request_reset_ex() 181 for (uint32_t i = 1; i <= srv->plugins.used; ++i) { in request_reset_ex() 183 request_plugin_ctx_check(r, srv); in request_reset_ex() 299 request_init_data(r, con, con->srv); in request_acquire() [all …]
|
| H A D | plugins.h | 8 int plugins_load(server *srv); 11 void plugins_free(server *srv); 26 void plugins_call_handle_trigger(server *srv); 27 handler_t plugins_call_handle_waitpid(server *srv, pid_t pid, int status); 30 void plugins_call_handle_sighup(server *srv); 33 handler_t plugins_call_init(server *srv); 36 handler_t plugins_call_set_defaults(server *srv); 39 handler_t plugins_call_worker_init(server *srv);
|
| H A D | configfile-glue.c | 44 int config_capture(server *srv, int idx) { in config_capture() argument 48 : (dc->capture_idx = ++srv->config_captures); in config_capture() 52 return srv->srvconf.feature_flags in config_feature_bool() 60 return srv->srvconf.feature_flags in config_feature_int() 131 log_error(srv->errh, __FILE__, __LINE__, in config_plugin_values_init_block() 188 log_error(srv->errh, __FILE__, __LINE__, in config_plugin_values_init_block() 274 log_error(srv->errh, __FILE__, __LINE__, in config_plugin_values_init_block() 276 srv->srvconf.config_unsupported = 1; in config_plugin_values_init_block() 279 log_error(srv->errh, __FILE__, __LINE__, in config_plugin_values_init_block() 281 srv->srvconf.config_deprecated = 1; in config_plugin_values_init_block() [all …]
|
| H A D | mod_mbedtls.c | 170 server *srv; member 421 elog(srv->errh, __FILE__,__LINE__, rc, in mod_mbedtls_init_once_mbedtls() 515 if (NULL == p->srv) return; in FREE_FUNC() 516 mod_mbedtls_free_config(p->srv, p); in FREE_FUNC() 1008 elogf(srv->errh, __FILE__, __LINE__, rc, in network_mbedtls_load_pemfile() 1454 elog(srv->errh, __FILE__,__LINE__, rc, in network_init_ssl() 1503 if (!srv->srvconf.h2proto) ++alpn_protos; in network_init_ssl() 1837 p->srv = srv; in SETDEFAULTS_FUNC() 1966 log_error(srv->errh, __FILE__, __LINE__, in SETDEFAULTS_FUNC() 2330 hctx->tmp_buf = con->srv->tmp_buf; in CONNECTION_FUNC() [all …]
|
| H A D | mod_openssl.c | 161 server *srv; member 808 log_error(srv->errh, __FILE__, __LINE__, in mod_openssl_load_verify_locn() 832 if (NULL == p->srv) return; in FREE_FUNC() 833 mod_openssl_free_config(p->srv, p); in FREE_FUNC() 1222 UNUSED(srv); in mod_openssl_client_hello_cb() 1253 UNUSED(srv); in network_ssl_servername_callback() 2226 UNUSED(srv); in mod_openssl_ssl_conf_curves() 2467 if (srv->srvconf.h2proto) in network_init_ssl() 2751 p->srv = srv; in SETDEFAULTS_FUNC() 3303 hctx->tmp_buf = con->srv->tmp_buf; in CONNECTION_FUNC() [all …]
|
| H A D | mod_wolfssl.c | 182 server *srv; member 499 log_error(srv->errh, __FILE__, __LINE__, in mod_openssl_init_once_openssl() 969 log_error(srv->errh, __FILE__, __LINE__, in mod_wolfssl_load_cacrls() 974 log_error(srv->errh, __FILE__, __LINE__, in mod_wolfssl_load_cacrls() 998 log_error(srv->errh, __FILE__, __LINE__, in mod_wolfssl_load_verify_locn() 1021 if (NULL == p->srv) return; in FREE_FUNC() 1022 mod_openssl_free_config(p->srv, p); in FREE_FUNC() 1354 UNUSED(srv); in network_ssl_servername_callback() 2534 p->srv = srv; in SETDEFAULTS_FUNC() 3003 hctx->tmp_buf = con->srv->tmp_buf; in CONNECTION_FUNC() [all …]
|
| H A D | mod_gnutls.c | 133 server *srv; member 288 mod_gnutls_session_ticket_key_init (server *srv) in mod_gnutls_session_ticket_key_init() argument 294 elog(srv->errh, __FILE__, __LINE__, rc, in mod_gnutls_session_ticket_key_init() 302 mod_gnutls_session_ticket_key_init(srv); in mod_gnutls_session_ticket_key_rotate() 676 if (NULL == p->srv) return; in FREE_FUNC() 677 mod_gnutls_free_config(p->srv, p); in FREE_FUNC() 949 log_error(srv->errh, __FILE__, __LINE__, in mod_gnutls_expire_stapling_file() 967 UNUSED(srv); in mod_gnutls_reload_stapling_file() 1835 buffer *b = srv->tmp_buf; in network_init_ssl() 2132 p->srv = srv; in SETDEFAULTS_FUNC() [all …]
|
| H A D | network.h | 12 int network_init(server *srv, int stdin_fd); 15 int network_close(server *srv); 18 int network_register_fdevents(server *srv); 21 void network_unregister_sock(server *srv, struct server_socket *srv_socket); 24 void network_socket_activation_to_env (server *srv);
|
| H A D | plugin.h | 10 static handler_t x(server *srv, void *p_d) 62 handler_t (* handle_trigger) (server *srv, void *p_d); /* once a second */ 63 handler_t (* handle_sighup) (server *srv, void *p_d); /* at a sighup */ 64 …handler_t (* handle_waitpid) (server *srv, void *p_d, pid_t pid, int status); /* upon a ch… 67 handler_t (* priv_defaults) (server *srv, void *p_d); 68 handler_t (* set_defaults) (server *srv, void *p_d); 69 …handler_t (* worker_init) (server *srv, void *p_d); /* at server startup (each worker a…
|
| H A D | connections.h | 9 void connections_pool_clear(server *srv); 12 void connections_free(server *srv); 15 void connection_graceful_shutdown_maint (server *srv); 17 void connection_periodic_maint (server *srv, unix_time64_t cur_ts); 21 connection * connection_accepted(server *srv, const struct server_socket *srv_socket, sock_addr *cn…
|
| H A D | connections.c | 49 --srv->lim_conns; in connections_get_new_connection() 50 if (srv->conns_pool) { in connections_get_new_connection() 51 con = srv->conns_pool; in connections_get_new_connection() 61 return (srv->conns = con); in connections_get_new_connection() 73 srv->conns_pool = con; in connection_del() 74 ++srv->lim_conns; in connection_del() 82 server * const srv = con->srv; in connection_close() local 100 --srv->cur_fds; in connection_close() 111 connection_del(srv, con); in connection_close() 503 con->srv = srv; in connection_init() [all …]
|
| H A D | mod_rewrite.c | 97 const int pcre_jit = config_feature_bool(srv, "server.pcre_jit", 1); in mod_rewrite_parse_list() 105 buffer * const tb = srv->tmp_buf; in mod_rewrite_parse_list() 109 if (srv->srvconf.http_url_normalize) { in mod_rewrite_parse_list() 121 if (!pcre_keyvalue_buffer_append(srv->errh, kvb, &ds->key, &ds->value, in mod_rewrite_parse_list() 123 log_error(srv->errh, __FILE__, __LINE__, in mod_rewrite_parse_list() 130 kvb->x0 = config_capture(srv, condidx); in mod_rewrite_parse_list() 161 if (!config_plugin_values_init(srv, p, cpk, "mod_rewrite")) in SETDEFAULTS_FUNC() 201 cpv->v.v = mod_rewrite_parse_list(srv, cpv->v.a, kvb, condidx); in SETDEFAULTS_FUNC() 208 cpv->v.v = mod_rewrite_parse_list(srv, cpv->v.a, kvb, condidx); in SETDEFAULTS_FUNC() 215 cpv->v.v = mod_rewrite_parse_list(srv, cpv->v.a, kvb, condidx); in SETDEFAULTS_FUNC() [all …]
|
| H A D | mod_nss.c | 177 server *srv; member 888 if (NULL == p->srv) return; in FREE_FUNC() 889 mod_nss_free_config(p->srv, p); in FREE_FUNC() 1051 log_error(srv->errh, __FILE__, __LINE__, in mod_nss_expire_stapling_file() 1104 mod_nss_expire_stapling_file(srv, pc); in mod_nss_reload_stapling_file() 1209 log_error(srv->errh, __FILE__, __LINE__, in network_nss_load_pemfile() 1702 elogf(srv->errh, __FILE__, __LINE__, in network_init_ssl() 1968 p->srv = srv; in SETDEFAULTS_FUNC() 2106 return mod_nss_set_defaults_sockets(srv, p); in SETDEFAULTS_FUNC() 2306 hctx->tmp_buf = con->srv->tmp_buf; in CONNECTION_FUNC() [all …]
|
| H A D | mod_redirect.c | 78 static pcre_keyvalue_buffer * mod_redirect_parse_list(server *srv, const array *a, const int condid… in mod_redirect_parse_list() argument 79 const int pcre_jit = config_feature_bool(srv, "server.pcre_jit", 1); in mod_redirect_parse_list() 82 buffer * const tb = srv->tmp_buf; in mod_redirect_parse_list() 86 if (srv->srvconf.http_url_normalize) { in mod_redirect_parse_list() 98 if (!pcre_keyvalue_buffer_append(srv->errh, kvb, &ds->key, &ds->value, in mod_redirect_parse_list() 100 log_error(srv->errh, __FILE__, __LINE__, in mod_redirect_parse_list() 107 kvb->x0 = config_capture(srv, condidx); in mod_redirect_parse_list() 125 if (!config_plugin_values_init(srv, p, cpk, "mod_redirect")) in SETDEFAULTS_FUNC() 136 mod_redirect_parse_list(srv, cpv->v.a, p->cvlist[i].k_id); in SETDEFAULTS_FUNC()
|
| H A D | mod_maxminddb.c | 163 mod_maxminddb_open_db (server *srv, const buffer *db_name) in mod_maxminddb_open_db() argument 168 log_error(srv->errh, __FILE__, __LINE__, in mod_maxminddb_open_db() 180 log_perror(srv->errh, __FILE__, __LINE__, in mod_maxminddb_open_db() 184 log_error(srv->errh, __FILE__, __LINE__, in mod_maxminddb_open_db() 193 mod_maxminddb_prep_cenv (server *srv, const array * const env) in mod_maxminddb_prep_cenv() argument 199 log_error(srv->errh, __FILE__, __LINE__, in mod_maxminddb_prep_cenv() 209 log_error(srv->errh, __FILE__, __LINE__, in mod_maxminddb_prep_cenv() 304 if (!config_plugin_values_init(srv, p, cpk, "mod_maxminddb")) in SETDEFAULTS_FUNC() 317 cpv->v.v = mod_maxminddb_open_db(srv, cpv->v.b); in SETDEFAULTS_FUNC() 324 cpv->v.v = mod_maxminddb_prep_cenv(srv, cpv->v.a); in SETDEFAULTS_FUNC()
|
| H A D | gw_backend.c | 1310 p->srv_pid = srv->pid; in gw_set_defaults_backend() 1748 log_error(srv->errh, __FILE__, __LINE__, in gw_get_defaults_balance() 1935 r->con->srv->cur_fds, r->con->srv->max_fds); in gw_write_request() 1939 ++r->con->srv->cur_fds; in gw_write_request() 2108 server * const srv = r->con->srv; in gw_write_error() local 2109 if (0 == srv->srvconf.max_worker) in gw_write_error() 2634 hctx->ev = r->con->srv->ev; in gw_check_extension() 2849 int wkr = (0 != srv->srvconf.max_worker && p->srv_pid != srv->pid); in gw_handle_trigger() 2850 log_error_st * const errh = srv->errh; in gw_handle_trigger() 2888 if (0 != srv->srvconf.max_worker && p->srv_pid != srv->pid) in gw_handle_waitpid_cb() [all …]
|
| H A D | mod_accesslog.c | 441 if (srv->srvconf.preflight_check) continue; in SETDEFAULTS_FUNC() 450 log_perror(srv->errh, __FILE__, __LINE__, in SETDEFAULTS_FUNC() 471 mod_accesslog_process_format(CONST_STR_LEN(fmt), srv); in SETDEFAULTS_FUNC() 480 accesslog_parse_format(format, flen, srv->errh); in mod_accesslog_process_format() 482 log_error(srv->errh, __FILE__, __LINE__, in mod_accesslog_process_format() 512 log_error(srv->errh, __FILE__, __LINE__, in mod_accesslog_process_format() 522 log_error(srv->errh, __FILE__, __LINE__, in mod_accesslog_process_format() 532 srv->srvconf.high_precision_timestamps = 1; in mod_accesslog_process_format() 545 log_error(srv->errh, __FILE__, __LINE__, in mod_accesslog_process_format() 565 log_error(srv->errh, __FILE__, __LINE__, in mod_accesslog_process_format() [all …]
|
| H A D | mod_proxy.c | 173 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_forwarded() 180 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_forwarded() 201 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_header_opts() 212 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_header_opts() 223 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_header_opts() 234 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_header_opts() 243 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_header_opts() 259 log_error(srv->errh, __FILE__, __LINE__, in mod_proxy_parse_header_opts() 303 if (!config_plugin_values_init(srv, p, cpk, "mod_proxy")) in SETDEFAULTS_FUNC() 324 log_error(srv->errh, __FILE__, __LINE__, in SETDEFAULTS_FUNC() [all …]
|