| 247 return err; |
247 return err; |
| 248 } |
248 } |
| 249 |
249 |
| 250 DavNamespace* dav_get_namespace(DavContext *context, const char *prefix) { |
250 DavNamespace* dav_get_namespace(DavContext *context, const char *prefix) { |
| 251 dav_context_lock(context); |
251 dav_context_lock(context); |
| 252 DavNamespace *ns = cxMapGet(context->namespaces, cx_hash_key_str(prefix)); |
252 DavNamespace *ns = cxMapGet(context->namespaces, prefix); |
| 253 dav_context_unlock(context); |
253 dav_context_unlock(context); |
| 254 return ns; |
254 return ns; |
| 255 } |
255 } |
| 256 |
256 |
| 257 DavNamespace* dav_get_namespace_s(DavContext *context, cxstring prefix) { |
257 DavNamespace* dav_get_namespace_s(DavContext *context, cxstring prefix) { |
| 258 dav_context_lock(context); |
258 dav_context_lock(context); |
| 259 DavNamespace *ns = cxMapGet(context->namespaces, cx_hash_key(prefix.ptr, prefix.length)); |
259 DavNamespace *ns = cxMapGet(context->namespaces, prefix); |
| 260 dav_context_unlock(context); |
260 dav_context_unlock(context); |
| 261 return ns; |
261 return ns; |
| 262 } |
262 } |
| 263 |
263 |
| 264 int dav_enable_namespace_encryption(DavContext *context, const char *ns, DavBool encrypt) { |
264 int dav_enable_namespace_encryption(DavContext *context, const char *ns, DavBool encrypt) { |