- if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, (char *) name_str, name_len+1, (void *) &hentry)) {
- lentry.handle = *handle;
- if (SUCCESS == zend_hash_next_index_insert(&hentry->list, (void *) &lentry, sizeof(http_persistent_handles_list_entry), NULL)) {
- status = SUCCESS;
+ if (name_str && name_len) {
+ if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, HTTP_ZAPI_CONST_CAST(char *) name_str, name_len+1, (void *) &provider)) {
+ if (current_ident_only) {
+ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) {
+ http_persistent_handle_list_dtor(list, provider->dtor);
+ http_persistent_handle_list_init(list);
+ }
+ } else {
+ FOREACH_HASH_VAL(pos1, &provider->list.free, listp) {
+ http_persistent_handle_list_dtor(*listp, provider->dtor);
+ http_persistent_handle_list_init(*listp);
+ }
+ }
+ }
+ } else {
+ FOREACH_HASH_VAL(pos1, &http_persistent_handles_hash, provider) {
+ if (current_ident_only) {
+ if ((list = http_persistent_handle_list_find(provider TSRMLS_CC))) {
+ http_persistent_handle_list_dtor(list, provider->dtor);
+ http_persistent_handle_list_init(list);
+ }
+ } else {
+ FOREACH_HASH_VAL(pos2, &provider->list.free, listp) {
+ http_persistent_handle_list_dtor(*listp, provider->dtor);
+ http_persistent_handle_list_init(*listp);
+ }
+ }