Lines 464-485
static int update_child_status_internal(int child_
Link Here
|
464 |
{ |
464 |
{ |
465 |
int old_status; |
465 |
int old_status; |
466 |
worker_score *ws; |
466 |
worker_score *ws; |
467 |
process_score *ps; |
|
|
468 |
int mpm_generation; |
467 |
int mpm_generation; |
469 |
|
468 |
|
470 |
ws = &ap_scoreboard_image->servers[child_num][thread_num]; |
469 |
ws = &ap_scoreboard_image->servers[child_num][thread_num]; |
471 |
old_status = ws->status; |
470 |
old_status = ws->status; |
472 |
if (status >= 0) { |
471 |
ws->status = status; |
473 |
ws->status = status; |
472 |
|
474 |
|
473 |
if (status == SERVER_READY |
475 |
ps = &ap_scoreboard_image->parent[child_num]; |
474 |
&& old_status == SERVER_STARTING) { |
476 |
|
475 |
process_score *ps = &ap_scoreboard_image->parent[child_num]; |
477 |
if (status == SERVER_READY |
476 |
ws->thread_num = child_num * thread_limit + thread_num; |
478 |
&& old_status == SERVER_STARTING) { |
477 |
ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation); |
479 |
ws->thread_num = child_num * thread_limit + thread_num; |
478 |
ps->generation = mpm_generation; |
480 |
ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation); |
|
|
481 |
ps->generation = mpm_generation; |
482 |
} |
483 |
} |
479 |
} |
484 |
|
480 |
|
485 |
if (ap_extended_status) { |
481 |
if (ap_extended_status) { |
Lines 497-541
static int update_child_status_internal(int child_
Link Here
|
497 |
ws->conn_bytes = 0; |
493 |
ws->conn_bytes = 0; |
498 |
ws->last_used = apr_time_now(); |
494 |
ws->last_used = apr_time_now(); |
499 |
} |
495 |
} |
500 |
if (status == SERVER_READY) { |
496 |
|
501 |
ws->client[0]='\0'; |
497 |
if (descr) { |
502 |
ws->vhost[0]='\0'; |
498 |
apr_cpystrn(ws->request, descr, sizeof(ws->request)); |
503 |
ws->request[0]='\0'; |
|
|
504 |
ws->protocol[0]='\0'; |
505 |
} |
499 |
} |
506 |
else { |
500 |
else if (r) { |
507 |
if (descr) { |
501 |
copy_request(ws->request, sizeof(ws->request), r); |
508 |
apr_cpystrn(ws->request, descr, sizeof(ws->request)); |
502 |
} |
|
|
503 |
else if (c && old_status == SERVER_READY) { |
504 |
apr_cpystrn(ws->request, c->sb_lastreq, |
505 |
sizeof(ws->request)); |
506 |
} |
507 |
|
508 |
if (r) { |
509 |
if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) |
510 |
apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client)); |
511 |
else |
512 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
513 |
} |
514 |
else if (c) { |
515 |
if (!(val = ap_get_remote_host(c, c->base_server->lookup_defaults, |
516 |
REMOTE_NOLOOKUP, NULL))) |
517 |
apr_cpystrn(ws->client, c->client_ip, sizeof(ws->client)); |
518 |
else |
519 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
520 |
} |
521 |
|
522 |
if (s) { |
523 |
if (c) { |
524 |
apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d", |
525 |
s->server_hostname, c->local_addr->port); |
509 |
} |
526 |
} |
510 |
else if (r) { |
527 |
else { |
511 |
copy_request(ws->request, sizeof(ws->request), r); |
528 |
apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost)); |
512 |
} |
529 |
} |
513 |
if (r) { |
530 |
} |
514 |
if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) |
531 |
else if (c && old_status == SERVER_READY) { |
515 |
apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client)); |
532 |
apr_cpystrn(ws->vhost, c->sb_lastvhost, |
516 |
else |
533 |
sizeof(ws->vhost)); |
517 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
534 |
} |
|
|
535 |
|
536 |
if (c) { |
537 |
val = ap_get_protocol(c); |
538 |
apr_cpystrn(ws->protocol, val, sizeof(ws->protocol)); |
539 |
|
540 |
if (status == SERVER_BUSY_LOG) { |
541 |
apr_cpystrn(c->sb_lastreq, ws->request, |
542 |
sizeof(c->sb_lastreq)); |
543 |
apr_cpystrn(c->sb_lastvhost, ws->vhost, |
544 |
sizeof(c->sb_lastreq)); |
518 |
} |
545 |
} |
519 |
else if (c) { |
|
|
520 |
if (!(val = ap_get_remote_host(c, c->base_server->lookup_defaults, |
521 |
REMOTE_NOLOOKUP, NULL))) |
522 |
apr_cpystrn(ws->client, c->client_ip, sizeof(ws->client)); |
523 |
else |
524 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
525 |
} |
526 |
if (s) { |
527 |
if (c) { |
528 |
apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d", |
529 |
s->server_hostname, c->local_addr->port); |
530 |
} |
531 |
else { |
532 |
apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost)); |
533 |
} |
534 |
} |
535 |
if (c) { |
536 |
val = ap_get_protocol(c); |
537 |
apr_cpystrn(ws->protocol, val, sizeof(ws->protocol)); |
538 |
} |
539 |
} |
546 |
} |
540 |
} |
547 |
} |
541 |
|
548 |
|