httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: pool vs. context
Date Wed, 12 Apr 2000 13:47:36 GMT

Okay, second issue now.

> what is really confusing me right now as i study the APR code and try to
> figure out if the ap_{set,get}_userdata API is even used is that there are
> numerous functions which all just wrap ap_{set,get}_userdata:

Your right, these functions are never used.  When I was creating contexts,
I was asked to create a way to add data to contexts, and to all APR
types.  I did that.  We are wrapping the functions, because currently
programmers can't get a context out of any of the APR types, and contexts
are incomplete types.

Once a decision is made on going back to calling the things pools (that
seems to be the groups leaning, and I really don't care what we call
them, they perform the same function), I can easily rip out the code that
allows us to add data to them and/or remove the functions wrappers, and
allow people to grab pools from APR types.

> % rgrep 'ap_[sg]et_[a-z]*data'
> ./apr_file_io.h:ap_status_t ap_get_filedata(void **data, char *key, ap_file_t *file);
> ./apr_file_io.h:ap_status_t ap_set_filedata(ap_file_t *file, void *data, char *key,
> ./apr_general.h:ap_status_t ap_set_userdata(void *data, char *key,
> ./apr_general.h:ap_status_t ap_get_userdata(void **, char *key, ap_context_t *cont);
> ./apr_lock.h:ap_status_t ap_get_lockdata(ap_lock_t *lock, char *key, void *data);
> ./apr_lock.h:ap_status_t ap_set_lockdata(ap_lock_t *lock, void *data, char *key,
> ./apr_network_io.h:ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t
*sock);
> ./apr_network_io.h:ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char
*key,
> ./apr_network_io.h:ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data);
> ./apr_network_io.h:ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char
*key,
> ./apr_thread_proc.h:ap_status_t ap_get_threaddata(void **data, char *key, ap_thread_t
*thread);
> ./apr_thread_proc.h:ap_status_t ap_set_threaddata(void *data, char *key,
> ./apr_thread_proc.h:ap_status_t ap_get_threadkeydata(void **data, char *key, ap_threadkey_t
*threadkey);
> ./apr_thread_proc.h:ap_status_t ap_set_threadkeydata(void *data, char *key,
> ./apr_thread_proc.h:ap_status_t ap_get_procdata(char *key, void *data, ap_proc_t *proc);
> ./apr_thread_proc.h:ap_status_t ap_set_procdata(void *data, char *key,
> 
> i thought the purpose of having the userdata stuff in the context was that
> it could be accessed from anywhere the context could be accessed.
> 
> i don't understand why we need all these extra functions.  at worst we
> should have an ap_get_filectx, ap_get_userctx, ... to fetch back the
> context pointer.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message