summaryrefslogtreecommitdiff
path: root/memory
diff options
context:
space:
mode:
authorRyan Bloom <rbb@apache.org>2002-10-22 02:23:20 +0000
committerRyan Bloom <rbb@apache.org>2002-10-22 02:23:20 +0000
commitab9eff9f2266f0119f49881c3838b22dca768f51 (patch)
tree6c0456537b9e68c6ef32cf09728b8ca1f5dca768 /memory
parent6dd9e8dc01f0a3fecb044f4968c5bfa97ddca6c2 (diff)
downloadapr-ab9eff9f2266f0119f49881c3838b22dca768f51.tar.gz
Allow people who use userdata to distinguish between a successful retrieval
from the pool userdata, and not being able to retrieve. We could also separate out when the hash doesn't exist, but I have left that for somebody else. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63959 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
-rw-r--r--memory/unix/apr_pools.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 7422de5d6..0d29b25bd 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -1860,10 +1860,16 @@ APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
apr_pool_check_integrity(pool);
#endif /* APR_POOL_DEBUG */
- if (pool->user_data == NULL)
+ if (pool->user_data == NULL) {
*data = NULL;
- else
+ }
+ else {
*data = apr_hash_get(pool->user_data, key, APR_HASH_KEY_STRING);
+ }
+
+ if (*data == NULL) {
+ return APR_KEYNOTFOUND;
+ }
return APR_SUCCESS;
}