]> granicus.if.org Git - apache/commitdiff
A change to how APR uses user data. Now, user data is a linked list that
authorRyan Bloom <rbb@apache.org>
Tue, 14 Sep 1999 13:37:45 +0000 (13:37 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 14 Sep 1999 13:37:45 +0000 (13:37 +0000)
is retreivable using a char string.  Basically, you provide a string that
will be used as a key when you store the data.  If the key was used before,
we will overwrite the old data.  When you want to retreive your data, pass
in the same key, and we will find the data you care about.  This also makes
it harder to put user data in when creating a context, so that option has
disappeared.  It is also impossible to inherit user data from parent contexts.
This option may be added in later.  I will be documenting this VERY soon.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83901 13f79535-47bb-0310-9956-ffa450edef68

modules/aaa/mod_auth.c
modules/generators/mod_autoindex.c
modules/http/http_core.c
modules/http/http_protocol.c
modules/http/http_request.c
server/main.c
server/mpm/dexter/dexter.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/prefork/prefork.c

index 163d4a226ff7a28bcebdc54bb78b5ebfcac2adeb..749060916f431b5dc1515492df4b0a4d3562a36a 100644 (file)
@@ -157,7 +157,7 @@ static ap_table_t *groups_for_user(ap_context_t *p, char *user, char *grpfile)
        return NULL;
     }
 
-    ap_create_context(p, NULL, &sp);
+    ap_create_context(p, &sp);
 
     while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) {
        if ((l[0] == '#') || (!l[0]))
index cdf47e1ed11fbfb4ae1e485d67a86ad49aa332b2..3909bd4125fb39c5108dd64c2cb785f8f9f71978 100644 (file)
@@ -1280,7 +1280,7 @@ static void output_directories(struct ent **ar, int n,
     char *name_scratch;
     char *pad_scratch;
 
-    ap_create_context(r->pool, NULL, &scratch);
+    ap_create_context(r->pool, &scratch);
     if (name[0] == '\0') {
        name = "/";
     }
index 3a33543ae48815cef0999a5672c994719e4a9c07..d39fd71ea60f79f0ebf1d3609b3bc48f5bbe4e63 100644 (file)
@@ -399,7 +399,7 @@ void ap_core_reorder_directories(ap_context_t *p, server_rec *s)
     elts = (void **)sec->elts;
 
     /* we have to allocate tmp space to do a stable sort */
-    ap_create_context(p, NULL, &tmp);
+    ap_create_context(p, &tmp);
     sortbin = ap_palloc(tmp, sec->nelts * sizeof(*sortbin));
     for (i = 0; i < nelts; ++i) {
        sortbin[i].orig_index = i;
index c099254318bf5695994b04a3cefdae3249e62784..99f5d800a9ed826ccaf06ca442b4b807ab1712ac 100644 (file)
@@ -927,7 +927,7 @@ request_rec *ap_read_request(conn_rec *conn)
     const char *expect;
     int access_status;
 
-    ap_create_context(conn->pool, NULL, &p);
+    ap_create_context(conn->pool, &p);
     r = ap_pcalloc(p, sizeof(request_rec));
     r->pool            = p;
     r->connection      = conn;
index 8e8b45522588e0e1d389fec0b69003d7566d6658..684ad983e79c7dd09fb55d761d4eae4447504517 100644 (file)
@@ -740,7 +740,7 @@ static request_rec *make_sub_request(const request_rec *r)
     ap_context_t *rrp;
     request_rec *rr;
     
-    ap_create_context(r->pool, NULL, &rrp);
+    ap_create_context(r->pool, &rrp);
     rr = ap_pcalloc(rrp, sizeof(request_rec));
     rr->pool = rrp;
     return rr;
index de68c512613a3f47deb5a28050b34b110053e4d4..87981a831aa905d9774eb1b9be88a837fe30de2e 100644 (file)
@@ -267,10 +267,10 @@ int main(int argc, char **argv)
     ap_util_init();
     ap_util_uri_init();
 
-    ap_create_context(NULL, NULL, &pglobal);
+    ap_create_context(NULL, &pglobal);
     g_pHookPool=pglobal;
 
-    ap_create_context(pglobal, NULL, &pcommands);
+    ap_create_context(pglobal, &pcommands);
     ap_server_pre_read_config  = ap_make_array(pcommands, 1, sizeof(char *));
     ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
     ap_server_config_defines   = ap_make_array(pcommands, 1, sizeof(char *));
@@ -317,9 +317,9 @@ int main(int argc, char **argv)
        }
     }
 
-    ap_create_context(pglobal, NULL, &pconf);
-    ap_create_context(pglobal, NULL, &plog);
-    ap_create_context(pconf, NULL, &ptemp);
+    ap_create_context(pglobal, &pconf);
+    ap_create_context(pglobal, &plog);
+    ap_create_context(pconf, &ptemp);
 
     /* for legacy reasons, we read the configuration twice before
        we actually serve any requests */
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
 
     for (;;) {
        ap_clear_pool(pconf);
-       ap_create_context(pconf, NULL, &ptemp);
+       ap_create_context(pconf, &ptemp);
        ap_server_root = def_server_root;
        ap_run_pre_config(pconf, plog, ptemp);
        server_conf = ap_read_config(pconf, ptemp, confname);
index ae65437573e2cbd5197ab1a8af80403e9707cd05..82e72637ca5a1e48ad9fb716a29c2866ce33f9eb 100644 (file)
@@ -858,9 +858,9 @@ static void *worker_thread(void *arg)
     int native_socket;
 
     pthread_mutex_lock(&thread_pool_create_mutex);
-    ap_create_context(thread_pool_parent, NULL, &tpool);
+    ap_create_context(thread_pool_parent, &tpool);
     pthread_mutex_unlock(&thread_pool_create_mutex);
-    ap_create_context(tpool, NULL, &ptrans);
+    ap_create_context(tpool, &ptrans);
 
     while (!workers_may_exit) {
         workers_may_exit |= (max_requests_per_child != 0) && (requests_this_child <= 0);
@@ -981,7 +981,7 @@ static void child_main(int child_num_arg)
 
     my_pid = getpid();
     child_num = child_num_arg;
-    ap_create_context(pconf, NULL, &pchild);
+    ap_create_context(pconf, &pchild);
 
     /*stuff to do before we switch id's, so we have permissions.*/
 
@@ -1026,7 +1026,7 @@ static void child_main(int child_num_arg)
     for (i = 0; i < max_threads; i++) {
         worker_thread_free_ids[i] = i;
     }
-    ap_create_context(pchild, NULL, &thread_pool_parent);
+    ap_create_context(pchild, &thread_pool_parent);
     pthread_mutex_init(&thread_pool_create_mutex, NULL);
     pthread_mutex_init(&idle_thread_count_mutex, NULL);
     pthread_mutex_init(&worker_thread_count_mutex, NULL);
index 420549381b078376afcdfecceac3663fd7efdc8c..908cf02e5172c57d353ad1cd57c962cdfbbb4146 100644 (file)
@@ -809,7 +809,7 @@ static void * worker_thread(void * dummy)
 
     free(ti);
 
-    ap_create_context(tpool, NULL, &ptrans);
+    ap_create_context(tpool, &ptrans);
 
     pthread_mutex_lock(&worker_thread_count_mutex);
     worker_thread_count++;
@@ -918,7 +918,7 @@ static void child_main(int child_num_arg)
     ap_listen_rec *lr;
 
     my_pid = getpid();
-    ap_create_context(pconf, NULL, &pchild);
+    ap_create_context(pconf, &pchild);
 
     /*stuff to do before we switch id's, so we have permissions.*/
     reopen_scoreboard(pchild);
@@ -972,7 +972,7 @@ static void child_main(int child_num_arg)
        my_info->pid = my_child_num;
         my_info->tid = i;
        my_info->sd = 0;
-       ap_create_context(pchild, NULL, &my_info->tpool);
+       ap_create_context(pchild, &my_info->tpool);
        
        /* We are creating threads right now */
        (void) ap_update_child_status(my_child_num, i, SERVER_STARTING, 
index a1fa75851c89d9ffc34e9092ec3b0597c320b39f..043eb15f306f157b03086d142b81b3c7f964a8e3 100644 (file)
@@ -1957,9 +1957,9 @@ static void child_main(int child_num_arg)
     /* Get a sub ap_context_t for global allocations in this child, so that
      * we can have cleanups occur when the child exits.
      */
-    ap_create_context(pconf, NULL, &pchild);
+    ap_create_context(pconf, &pchild);
 
-    ap_create_context(pchild, NULL, &ptrans);
+    ap_create_context(pchild, &ptrans);
 
     /* needs to be done before we switch UIDs so we have permissions */
     reopen_scoreboard(pchild);