From: Stefan Eissing Date: Tue, 19 Apr 2022 10:16:02 +0000 (+0000) Subject: *) core: add ap_sb_get_child_thread() to retrieve child_num X-Git-Tag: 2.5.0-alpha2-ci-test-only~381 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d74016b80d2cf537811499df6bb46b079c8312e;p=thirdparty%2Fapache%2Fhttpd.git *) core: add ap_sb_get_child_thread() to retrieve child_num and thread_num from a scoreboard handle. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900029 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 7b6753cbe4c..88868775a71 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -710,6 +710,7 @@ * Add new http/1.x formatting helpers * Add ap_assign_request_line() * 20211221.7 (2.5.1-dev) Add ap_h1_append_header() + * 20211221.8 (2.5.1-dev) Add ap_sb_get_child_thread() */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -717,7 +718,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20211221 #endif -#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 8 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/scoreboard.h b/include/scoreboard.h index 321b32778a0..7cf92e405a4 100644 --- a/include/scoreboard.h +++ b/include/scoreboard.h @@ -183,6 +183,8 @@ AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p, int child_num, int thread_num); AP_DECLARE(void) ap_update_sb_handle(ap_sb_handle_t *sbh, int child_num, int thread_num); +AP_DECLARE(void) ap_sb_get_child_thread(ap_sb_handle_t *sbh, + int *pchild_num, int *pthread_num); AP_DECLARE(int) ap_find_child_by_pid(apr_proc_t *pid); AP_DECLARE(int) ap_update_child_status(ap_sb_handle_t *sbh, int status, request_rec *r); diff --git a/server/scoreboard.c b/server/scoreboard.c index 688f89f75f4..181477e3578 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -429,6 +429,14 @@ AP_DECLARE(void) ap_create_sb_handle(ap_sb_handle_t **new_sbh, apr_pool_t *p, ap_update_sb_handle(*new_sbh, child_num, thread_num); } +AP_DECLARE(void) ap_sb_get_child_thread(ap_sb_handle_t *sbh, + int *pchild_num, int *pthread_num) +{ + AP_DEBUG_ASSERT(sbh); + *pchild_num = sbh->child_num; + *pthread_num = sbh->thread_num; +} + static void copy_request(char *rbuf, apr_size_t rbuflen, request_rec *r) { char *p;