X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_persistent_handle_api.c;h=c31ead1de44da65e05adf9119779c4b53d1041ea;hp=ec345fb6a8b88ac413acf75ac683a789b8ed73a5;hb=da1843cf6d0047c118dd052520c2fba230e7f10f;hpb=db5299a8b005bf625b4e34666b48e6cce8990482 diff --git a/http_persistent_handle_api.c b/http_persistent_handle_api.c index ec345fb..c31ead1 100644 --- a/http_persistent_handle_api.c +++ b/http_persistent_handle_api.c @@ -20,6 +20,10 @@ #ifndef HTTP_DEBUG_PHANDLES # define HTTP_DEBUG_PHANDLES 0 #endif +#if HTTP_DEBUG_PHANDLES +# undef inline +# define inline +#endif static HashTable http_persistent_handles_hash; #ifdef ZTS @@ -98,7 +102,7 @@ static inline http_persistent_handle_list *http_persistent_handle_list_find(http } if ((new_list = http_persistent_handle_list_init(NULL))) { - if (SUCCESS == zend_hash_quick_add(&provider->list.free, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &new_list, sizeof(http_persistent_handle_list *), (void *) &list)) { + if (SUCCESS == zend_hash_quick_add(&provider->list.free, HTTP_G->persistent.handles.ident.s, HTTP_G->persistent.handles.ident.l, HTTP_G->persistent.handles.ident.h, (void *) &new_list, sizeof(http_persistent_handle_list), (void *) &list)) { return *list; } http_persistent_handle_list_free(&new_list, provider->dtor); @@ -250,6 +254,9 @@ PHP_HTTP_API STATUS _http_persistent_handle_release_ex(const char *name_str, siz { STATUS status = FAILURE; http_persistent_handle_provider *provider; +#if HTTP_DEBUG_PHANDLES + void *handle_tmp = *handle_ptr; +#endif LOCK(); if (SUCCESS == zend_hash_find(&http_persistent_handles_hash, (char *) name_str, name_len+1, (void *) &provider)) { @@ -258,7 +265,7 @@ PHP_HTTP_API STATUS _http_persistent_handle_release_ex(const char *name_str, siz UNLOCK(); #if HTTP_DEBUG_PHANDLES - fprintf(stderr, "RELEASE: %p (%s)\n", *handle_ptr, name_str); + fprintf(stderr, "RELEASE: %p (%s)\n", handle_tmp, name_str); #endif return status;