| 473 | } |
| 474 | |
| 475 | static int update_child_status_internal(int child_num, |
| 476 | int thread_num, |
| 477 | int status, |
| 478 | conn_rec *c, |
| 479 | server_rec *s, |
| 480 | request_rec *r, |
| 481 | const char *descr) |
| 482 | { |
| 483 | int old_status; |
| 484 | worker_score *ws; |
| 485 | int mpm_generation; |
| 486 | |
| 487 | ws = &ap_scoreboard_image->servers[child_num][thread_num]; |
| 488 | old_status = ws->status; |
| 489 | ws->status = status; |
| 490 | |
| 491 | if (status == SERVER_READY |
| 492 | && old_status == SERVER_STARTING) { |
| 493 | process_score *ps = &ap_scoreboard_image->parent[child_num]; |
| 494 | ws->thread_num = child_num * thread_limit + thread_num; |
| 495 | ap_mpm_query(AP_MPMQ_GENERATION, &mpm_generation); |
| 496 | ps->generation = mpm_generation; |
| 497 | } |
| 498 | |
| 499 | if (ap_extended_status) { |
| 500 | const char *val; |
| 501 | |
| 502 | if (status == SERVER_READY || status == SERVER_DEAD) { |
| 503 | /* |
| 504 | * Reset individual counters |
| 505 | */ |
| 506 | if (status == SERVER_DEAD) { |
| 507 | ws->my_access_count = 0L; |
| 508 | ws->my_bytes_served = 0L; |
| 509 | #ifdef HAVE_TIMES |
| 510 | ws->times.tms_utime = 0; |
| 511 | ws->times.tms_stime = 0; |
| 512 | ws->times.tms_cutime = 0; |
| 513 | ws->times.tms_cstime = 0; |
| 514 | #endif |
| 515 | } |
| 516 | ws->conn_count = 0; |
| 517 | ws->conn_bytes = 0; |
| 518 | ws->last_used = apr_time_now(); |
| 519 | } |
| 520 | |
| 521 | if (descr) { |
| 522 | apr_cpystrn(ws->request, descr, sizeof(ws->request)); |
| 523 | } |
| 524 | else if (r) { |
| 525 | copy_request(ws->request, sizeof(ws->request), r); |
| 526 | } |
| 527 | else if (c) { |
| 528 | ws->request[0]='\0'; |
| 529 | } |
| 530 | |
| 531 | if (r && r->useragent_ip) { |
| 532 | if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) { |
no test coverage detected