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-542
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)); |
|
|
499 |
} |
500 |
else if (r) { |
501 |
copy_request(ws->request, sizeof(ws->request), r); |
502 |
} |
503 |
else if (c) { |
503 |
ws->request[0]='\0'; |
504 |
ws->request[0]='\0'; |
504 |
ws->protocol[0]='\0'; |
|
|
505 |
} |
505 |
} |
506 |
else { |
506 |
|
507 |
if (descr) { |
507 |
if (r && r->useragent_ip) { |
508 |
apr_cpystrn(ws->request, descr, sizeof(ws->request)); |
508 |
if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) |
|
|
509 |
apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client)); |
510 |
else |
511 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
512 |
} |
513 |
else if (c) { |
514 |
if (!(val = ap_get_remote_host(c, c->base_server->lookup_defaults, |
515 |
REMOTE_NOLOOKUP, NULL))) |
516 |
apr_cpystrn(ws->client, c->client_ip, sizeof(ws->client)); |
517 |
else |
518 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
519 |
} |
520 |
|
521 |
if (s) { |
522 |
if (c) { |
523 |
apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d", |
524 |
s->server_hostname, c->local_addr->port); |
509 |
} |
525 |
} |
510 |
else if (r) { |
526 |
else { |
511 |
copy_request(ws->request, sizeof(ws->request), r); |
527 |
apr_cpystrn(ws->vhost, s->server_hostname, sizeof(ws->vhost)); |
512 |
} |
528 |
} |
513 |
if (r) { |
|
|
514 |
if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) |
515 |
apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client)); |
516 |
else |
517 |
apr_cpystrn(ws->client, val, sizeof(ws->client)); |
518 |
} |
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 |
} |
529 |
} |
|
|
530 |
else if (c) { |
531 |
ws->vhost[0]='\0'; |
532 |
} |
533 |
|
534 |
if (c) { |
535 |
val = ap_get_protocol(c); |
536 |
apr_cpystrn(ws->protocol, val, sizeof(ws->protocol)); |
537 |
} |
540 |
} |
538 |
} |
541 |
|
539 |
|
542 |
return old_status; |
540 |
return old_status; |