summaryrefslogtreecommitdiff
path: root/memory
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2002-10-22 02:23:20 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>2002-10-22 02:23:20 +0000
commit47353e7cba4a0da6c7c34ec3478e5a3208cd7a16 (patch)
tree6c0456537b9e68c6ef32cf09728b8ca1f5dca768 /memory
parentaea710d45bfe6a9dd2ecffdecdeb21030f59d762 (diff)
downloadlibapr-47353e7cba4a0da6c7c34ec3478e5a3208cd7a16.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: http://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;
}