#include "ap_config.h"
#include "apr_hooks.h"
#include "apr_thread_proc.h"
#include "apr_portable.h"
#include "apr_shm.h"
#include "apr_optional.h"
Go to the source code of this file.
Definition in file scoreboard.h.
|
|
Definition at line 45 of file scoreboard.h. Referenced by open_scoreboard(), show_compile_settings(), and show_server_settings(). |
|
|
Definition at line 91 of file scoreboard.h. |
|
|
Definition at line 90 of file scoreboard.h. |
|
|
Definition at line 65 of file scoreboard.h. Referenced by display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 63 of file scoreboard.h. Referenced by ap_process_http_connection(), display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 64 of file scoreboard.h. Referenced by ap_process_request(), ap_read_request(), display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 61 of file scoreboard.h. Referenced by ap_process_http_async_connection(), ap_process_http_connection(), core_create_conn(), display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 62 of file scoreboard.h. Referenced by ap_process_http_async_connection(), ap_process_http_connection(), display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 66 of file scoreboard.h. Referenced by AP_DECLARE(), display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 58 of file scoreboard.h. Referenced by add_worker(), ap_mpm_child_main(), ap_mpm_run(), clean_child_exit(), display_settings(), make_child(), make_worker(), perform_idle_server_maintenance(), server_main_loop(), start_threads(), startup_children(), status_handler(), status_init(), thread_exception_handler(), worker_main(), and worker_thread(). |
|
|
Definition at line 67 of file scoreboard.h. Referenced by ap_mpm_run(), display_settings(), perform_idle_server_maintenance(), start_threads(), status_handler(), status_init(), and worker_thread(). |
|
|
Definition at line 68 of file scoreboard.h. Referenced by display_settings(), status_handler(), and status_init(). |
|
|
Definition at line 69 of file scoreboard.h. Referenced by display_settings(). |
|
|
Definition at line 60 of file scoreboard.h. Referenced by child_main(), display_settings(), perform_idle_server_maintenance(), server_maintenance(), status_handler(), status_init(), worker_main(), and worker_thread(). |
|
|
Definition at line 59 of file scoreboard.h. Referenced by add_worker(), display_settings(), make_child(), make_worker(), start_threads(), status_handler(), status_init(), and worker_thread(). |
|
|
Definition at line 222 of file scoreboard.h. Referenced by ap_process_request(), and ap_time_process_request(). |
|
|
Definition at line 223 of file scoreboard.h. Referenced by ap_process_request(), and ap_time_process_request(). |
|
|
Definition at line 80 of file scoreboard.h. |
|
|
Definition at line 172 of file scoreboard.h. |
|
|
Definition at line 155 of file scoreboard.h. |
|
|
Definition at line 144 of file scoreboard.h. |
|
|
Definition at line 100 of file scoreboard.h. |
|
|
Definition at line 85 of file scoreboard.h. 00085 { 00086 SB_NOT_SHARED = 1, 00087 SB_SHARED = 2 00088 } ap_scoreboard_e;
|
|
|
Definition at line 249 of file scoreboard.c. References ap_cleanup_shared_mem(), ap_scoreboard_image, APR_SUCCESS, scoreboard::global, NULL, SB_SHARED, and global_score::sb_type. Referenced by ap_create_scoreboard(). 00250 { 00251 if (ap_scoreboard_image == NULL) { 00252 return APR_SUCCESS; 00253 } 00254 if (ap_scoreboard_image->global->sb_type == SB_SHARED) { 00255 ap_cleanup_shared_mem(NULL); 00256 } 00257 else { 00258 free(ap_scoreboard_image->global); 00259 free(ap_scoreboard_image); 00260 ap_scoreboard_image = NULL; 00261 } 00262 return APR_SUCCESS; 00263 }
|
|
||||||||||||
|
Definition at line 268 of file scoreboard.c. References ap_cleanup_scoreboard(), ap_init_scoreboard(), ap_scoreboard_image, APLOG_CRIT, APLOG_MARK, scoreboard::balancers, scoreboard::global, HTTP_INTERNAL_SERVER_ERROR, NULL, OK, open_scoreboard(), scoreboard::parent, global_score::restart_time, global_score::running_generation, SB_SHARED, global_score::sb_type, scoreboard::servers, and strerror(). Referenced by register_hooks(). 00269 { 00270 int running_gen = 0; 00271 int i; 00272 #if APR_HAS_SHARED_MEMORY 00273 apr_status_t rv; 00274 #endif 00275 00276 if (ap_scoreboard_image) { 00277 running_gen = ap_scoreboard_image->global->running_generation; 00278 ap_scoreboard_image->global->restart_time = apr_time_now(); 00279 memset(ap_scoreboard_image->parent, 0, 00280 sizeof(process_score) * server_limit); 00281 for (i = 0; i < server_limit; i++) { 00282 memset(ap_scoreboard_image->servers[i], 0, 00283 sizeof(worker_score) * thread_limit); 00284 } 00285 /* Clean up the lb workers data */ 00286 if (lb_limit) { 00287 memset(ap_scoreboard_image->balancers, 0, 00288 sizeof(lb_score) * lb_limit); 00289 } 00290 return OK; 00291 } 00292 00293 ap_calc_scoreboard_size(); 00294 #if APR_HAS_SHARED_MEMORY 00295 if (sb_type == SB_SHARED) { 00296 void *sb_shared; 00297 rv = open_scoreboard(p); 00298 if (rv || !(sb_shared = apr_shm_baseaddr_get(ap_scoreboard_shm))) { 00299 return HTTP_INTERNAL_SERVER_ERROR; 00300 } 00301 memset(sb_shared, 0, scoreboard_size); 00302 ap_init_scoreboard(sb_shared); 00303 } 00304 else 00305 #endif 00306 { 00307 /* A simple malloc will suffice */ 00308 void *sb_mem = calloc(1, scoreboard_size); 00309 if (sb_mem == NULL) { 00310 ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, 00311 "(%d)%s: cannot allocate scoreboard", 00312 errno, strerror(errno)); 00313 return HTTP_INTERNAL_SERVER_ERROR; 00314 } 00315 ap_init_scoreboard(sb_mem); 00316 } 00317 00318 ap_scoreboard_image->global->sb_type = sb_type; 00319 ap_scoreboard_image->global->running_generation = running_gen; 00320 ap_scoreboard_image->global->restart_time = apr_time_now(); 00321 00322 apr_pool_cleanup_register(p, NULL, ap_cleanup_scoreboard, apr_pool_cleanup_null); 00323 00324 return OK; 00325 }
|
|
|
Definition at line 114 of file scoreboard.c. References ap_assert, ap_scoreboard_image, scoreboard::balancers, scoreboard::global, global_score::lb_limit, scoreboard::parent, global_score::server_limit, scoreboard::servers, and global_score::thread_limit. Referenced by ap_create_scoreboard(), ap_mpm_child_main(), and master_main(). 00115 { 00116 char *more_storage; 00117 int i; 00118 00119 ap_calc_scoreboard_size(); 00120 ap_scoreboard_image = 00121 calloc(1, sizeof(scoreboard) + server_limit * sizeof(worker_score *) + 00122 server_limit * lb_limit * sizeof(lb_score *)); 00123 more_storage = shared_score; 00124 ap_scoreboard_image->global = (global_score *)more_storage; 00125 more_storage += sizeof(global_score); 00126 ap_scoreboard_image->parent = (process_score *)more_storage; 00127 more_storage += sizeof(process_score) * server_limit; 00128 ap_scoreboard_image->servers = 00129 (worker_score **)((char*)ap_scoreboard_image + sizeof(scoreboard)); 00130 for (i = 0; i < server_limit; i++) { 00131 ap_scoreboard_image->servers[i] = (worker_score *)more_storage; 00132 more_storage += thread_limit * sizeof(worker_score); 00133 } 00134 if (lb_limit) { 00135 ap_scoreboard_image->balancers = (lb_score *)more_storage; 00136 more_storage += lb_limit * sizeof(lb_score); 00137 } 00138 ap_assert(more_storage == (char*)shared_score + scoreboard_size); 00139 ap_scoreboard_image->global->server_limit = server_limit; 00140 ap_scoreboard_image->global->thread_limit = thread_limit; 00141 ap_scoreboard_image->global->lb_limit = lb_limit; 00142 }
|
|
||||||||||||||||
|
Definition at line 228 of file scoreboard.c. References APLOG_CRIT, APLOG_MARK, APR_EINVAL, APR_SUCCESS, and NULL. Referenced by child_main(). 00229 { 00230 #if APR_HAS_SHARED_MEMORY 00231 if (!detached) { 00232 return APR_SUCCESS; 00233 } 00234 if (apr_shm_size_get(ap_scoreboard_shm) < scoreboard_size) { 00235 ap_log_error(APLOG_MARK, APLOG_CRIT, 0, NULL, 00236 "Fatal error: shared scoreboard too small for child!"); 00237 apr_shm_detach(ap_scoreboard_shm); 00238 ap_scoreboard_shm = NULL; 00239 return APR_EINVAL; 00240 } 00241 /* everything will be cleared shortly */ 00242 if (*shm) { 00243 *shm = ap_scoreboard_shm; 00244 } 00245 #endif 00246 return APR_SUCCESS; 00247 }
|
|
||||||||||||
|
Definition at line 478 of file scoreboard.c. References ap_scoreboard_image, scoreboard::servers, START_PREQUEST, worker_score::start_time, STOP_PREQUEST, and worker_score::stop_time. Referenced by ap_process_request(). 00479 { 00480 worker_score *ws; 00481 00482 if (sbh->child_num < 0) { 00483 return; 00484 } 00485 00486 ws = &ap_scoreboard_image->servers[sbh->child_num][sbh->thread_num]; 00487 00488 if (status == START_PREQUEST) { 00489 ws->start_time = apr_time_now(); 00490 } 00491 else if (status == STOP_PREQUEST) { 00492 ws->stop_time = apr_time_now(); 00493 } 00494 }
|
|
|
Definition at line 360 of file scoreboard.c. References AP_MPMQ_MAX_DAEMONS, ap_scoreboard_image, max_daemons_limit, scoreboard::parent, process_score::pid, and apr_proc_t::pid. Referenced by ap_mpm_run(), and server_main_loop(). 00361 { 00362 int i; 00363 int max_daemons_limit; 00364 00365 ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons_limit); 00366 00367 for (i = 0; i < max_daemons_limit; ++i) { 00368 if (ap_scoreboard_image->parent[i].pid == pid->pid) { 00369 return i; 00370 } 00371 } 00372 00373 return -1; 00374 }
|
|
|
Definition at line 42 of file scoreboard.c. Referenced by ap_process_http_async_connection(), ap_process_http_connection(), ap_process_request(), APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(), mpmt_os2_pre_config(), netware_pre_config(), prefork_pre_config(), status_handler(), and worker_pre_config(). |
|
|
Definition at line 43 of file scoreboard.c. Referenced by copy_request(), and set_reqtail(). |
|
|
Definition at line 159 of file beos.c. Referenced by accept_mutex_off(), accept_mutex_on(), ap_mpm_child_main(), ap_mpm_run(), child_main(), os_fork(), spawn_child(), status_handler(), and worker_thread(). |
|
|
Definition at line 218 of file scoreboard.h. Referenced by AP_DECLARE(), and register_hooks(). |
|
|
Definition at line 41 of file scoreboard.c. Referenced by ap_mpm_child_main(), ap_mpm_run(), master_main(), and open_scoreboard(). |
|
|
|
Definition at line 183 of file scoreboard.h. Referenced by APR_HOOK_STRUCT(). |
|
|
Definition at line 188 of file scoreboard.h. |
|
|
Definition at line 188 of file scoreboard.h. |
|
|
Definition at line 188 of file scoreboard.h. Referenced by APR_HOOK_STRUCT(). |
|
|
|
Definition at line 192 of file scoreboard.h. Referenced by AP_DECLARE(), find_title(), gen_unique_id(), getword(), pointinpoly(), PROXY_DECLARE(), and ServiceDlgProc(). |