From: Christophe Jaillet Date: Sat, 6 Mar 2021 07:18:56 +0000 (+0000) Subject: Follow-up to r1887244. X-Git-Tag: 2.5.0-alpha2-ci-test-only~1006 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10fbe98e442e135b33117ddc122462629ab52769;p=thirdparty%2Fapache%2Fhttpd.git Follow-up to r1887244. Wrong version of the patch attached :( git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887245 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/metadata/mod_unique_id.c b/modules/metadata/mod_unique_id.c index 399adf8713e..3327f4c62f5 100644 --- a/modules/metadata/mod_unique_id.c +++ b/modules/metadata/mod_unique_id.c @@ -170,7 +170,7 @@ static const char uuencoder[64] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_', }; -#define THREADED_COUNTER "unique_id_thread_counter" +#define THREADED_COUNTER "unique_id_counter" static const char *gen_unique_id(const request_rec *r) { @@ -187,12 +187,13 @@ static const char *gen_unique_id(const request_rec *r) unsigned char *x,*y; unsigned short counter; int i,j,k; + #if APR_HAS_THREADS apr_status_t rv; unsigned short *pcounter; apr_thread_t *thread = r->connection->current_thread; - rv = apr_thread_data_get(&pcounter, THREADED_COUNTER, thread); + rv = apr_thread_data_get((void **)&pcounter, THREADED_COUNTER, thread); if (rv == APR_SUCCESS && pcounter) { counter = *pcounter; } @@ -206,12 +207,11 @@ static const char *gen_unique_id(const request_rec *r) new_unique_id.counter = htons(counter++); #if APR_HAS_THREADS if (!pcounter) { - pcounter = apr_palloc(apr_thread_pool_get(r->connection->current_thread), - sizeof(*pcounter)); + pcounter = apr_palloc(apr_thread_pool_get(thread), sizeof(*pcounter)); } *pcounter = counter; - rv = apr_thread_data_set(pcounter, THREADED_COUNTER, thread); + rv = apr_thread_data_set(pcounter, THREADED_COUNTER, NULL, thread); if (rv != APR_SUCCESS) #endif {