- if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, (char *) name_str, name_len+1, (void *) &hentry)) {
- zend_hash_internal_pointer_reset(&hentry->list);
- if ( HASH_KEY_NON_EXISTANT != zend_hash_get_current_key(&hentry->list, NULL, &index, 0) &&
- SUCCESS == zend_hash_get_current_data(&hentry->list, (void *) &lentry)) {
- *handle = lentry->handle;
- zend_hash_index_del(&hentry->list, index);
- status = SUCCESS;
- } else if ((*handle = hentry->ctor())) {
- status = SUCCESS;
+ if (name_str && name_len) {
+ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, (char *) name_str, name_len+1, (void *) &provider)) {
+ if (current_ident_only) {
+ if (SUCCESS == zend_hash_quick_find(provider->list, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &list)) {
+ FOREACH_HASH_VAL(pos1, *list, handle) {
+ provider->dtor(handle->ptr);
+ }
+ zend_hash_clean(*list);
+ }
+ } else {
+ FOREACH_HASH_VAL(pos1, provider->list, list) {
+ FOREACH_HASH_VAL(pos2, *list, handle) {
+ provider->dtor(handle->ptr);
+ }
+ zend_hash_clean(*list);
+ }
+ }
+ }
+ } else {
+ FOREACH_HASH_VAL(pos1, &http_persistent_handles_hash, provider) {
+ if (current_ident_only) {
+ if (SUCCESS == zend_hash_quick_find(provider->list, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &list)) {
+ FOREACH_HASH_VAL(pos2, *list, handle) {
+ provider->dtor(handle->ptr);
+ }
+ zend_hash_clean(*list);
+ }
+ } else {
+ FOREACH_HASH_VAL(pos2, provider->list, list) {
+ FOREACH_HASH_VAL(pos3, *list, handle) {
+ provider->dtor(handle->ptr);
+ }
+ zend_hash_clean(*list);
+ }
+ }