+PHP_HTTP_API php_http_persistent_handle_factory_t *php_http_persistent_handle_concede(php_http_persistent_handle_factory_t *a, const char *name_str, size_t name_len, const char *ident_str, size_t ident_len TSRMLS_DC)
+{
+ STATUS status = FAILURE;
+ php_http_persistent_handle_factory_t *free_a = NULL;
+
+ if (!a) {
+ free_a = a = emalloc(sizeof(*a));
+ }
+ memset(a, 0, sizeof(*a));
+
+ LOCK();
+ status = zend_hash_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &a->provider);
+ UNLOCK();
+
+ if (SUCCESS == status) {
+ a->ident.str = estrndup(ident_str, a->ident.len = ident_len);
+ if (free_a) {
+ a->free_on_abandon = 1;
+ }
+ } else {
+ if (free_a) {
+ efree(a);
+ }
+ a = NULL;
+ }
+
+#if PHP_HTTP_DEBUG_PHANDLES
+ fprintf(stderr, "CONCETE: %p (%s) (%s)\n", a ? a->provider : NULL, name_str, ident_str);
+#endif
+
+ return a;
+}
+
+PHP_HTTP_API void php_http_persistent_handle_abandon(php_http_persistent_handle_factory_t *a)
+{
+ zend_bool f = a->free_on_abandon;
+
+ STR_FREE(a->ident.str);
+ memset(a, 0, sizeof(*a));
+ if (f) {
+ efree(a);
+ }
+}
+
+PHP_HTTP_API void *php_http_persistent_handle_acquire(php_http_persistent_handle_factory_t *a TSRMLS_DC)
+{
+ void *handle = NULL;
+
+ LOCK();
+ php_http_persistent_handle_do_acquire(a->provider, a->ident.str, a->ident.len, &handle TSRMLS_CC);
+ UNLOCK();
+
+ return handle;
+}
+
+PHP_HTTP_API void *php_http_persistent_handle_accrete(php_http_persistent_handle_factory_t *a, void *handle TSRMLS_DC)
+{
+ void *new_handle;
+
+ LOCK();
+ php_http_persistent_handle_do_accrete(a->provider, a->ident.str, a->ident.len, handle, &new_handle TSRMLS_CC);
+ UNLOCK();
+
+ return new_handle;
+}
+
+PHP_HTTP_API void php_http_persistent_handle_release(php_http_persistent_handle_factory_t *a, void *handle TSRMLS_DC)
+{
+ LOCK();
+ php_http_persistent_handle_do_release(a->provider, a->ident.str, a->ident.len, &handle);
+ UNLOCK();
+}
+
+PHP_HTTP_API STATUS php_http_persistent_handle_acquire2(const char *name_str, size_t name_len, const char *ident_str, size_t ident_len, void **handle TSRMLS_DC)