You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2021/03/06 07:18:56 UTC

svn commit: r1887245 - /httpd/httpd/trunk/modules/metadata/mod_unique_id.c

Author: jailletc36
Date: Sat Mar  6 07:18:56 2021
New Revision: 1887245

URL: http://svn.apache.org/viewvc?rev=1887245&view=rev
Log:
Follow-up to r1887244.

Wrong version of the patch attached :(

Modified:
    httpd/httpd/trunk/modules/metadata/mod_unique_id.c

Modified: httpd/httpd/trunk/modules/metadata/mod_unique_id.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_unique_id.c?rev=1887245&r1=1887244&r2=1887245&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_unique_id.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_unique_id.c Sat Mar  6 07:18:56 2021
@@ -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 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 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
     {