From: Uwe Steinmann Date: Mon, 27 Jan 2003 09:11:17 +0000 (+0000) Subject: - fixed several bugs in hw_document_xx() functions. The macro to access X-Git-Tag: PHP_5_0_dev_before_13561_fix~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c375b0b05ccc883f832eed30362bfca873d23738;p=php - fixed several bugs in hw_document_xx() functions. The macro to access the document was the same as for a link to the sever. --- diff --git a/ext/hyperwave/hw.c b/ext/hyperwave/hw.c index 0f35e101d1..4975b9586f 100644 --- a/ext/hyperwave/hw.c +++ b/ext/hyperwave/hw.c @@ -154,8 +154,8 @@ ZEND_GET_MODULE(hw) #define HW_FETCH_ID(hw_zval) \ convert_to_long_ex(hw_zval); \ id = Z_LVAL_PP(hw_zval); \ - ptr = zend_list_find(id, &type); \ - if(!ptr || (type != le_socketp && type != le_psocketp)) { \ + ptr = (hw_document *) zend_list_find(id, &type); \ + if(!ptr || (type != le_document)) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find file identifier %d", id); \ RETURN_FALSE; \ } @@ -983,14 +983,14 @@ PHP_FUNCTION(hw_pconnect) PHP_FUNCTION(hw_close) { zval **arg1; - int id, type; + int link, type; hw_connection *ptr; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } - HW_FETCH_ID(arg1); - zend_list_delete(id); + HW_FETCH_LINK(arg1); + zend_list_delete(link); RETURN_TRUE; } /* }}} */ @@ -1000,14 +1000,14 @@ PHP_FUNCTION(hw_close) PHP_FUNCTION(hw_info) { pval **arg1; - int id, type; + int link, type; hw_connection *ptr; char *str; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } - HW_FETCH_ID(arg1); + HW_FETCH_LINK(arg1); if(NULL != (str = get_hw_info(ptr))) { /* php_printf("%s\n", str); @@ -1027,13 +1027,13 @@ PHP_FUNCTION(hw_info) PHP_FUNCTION(hw_error) { pval **arg1; - int id, type; + int link, type; hw_connection *ptr; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } - HW_FETCH_ID(arg1); + HW_FETCH_LINK(arg1); RETURN_LONG(ptr->lasterror); } /* }}} */ @@ -1043,14 +1043,14 @@ PHP_FUNCTION(hw_error) PHP_FUNCTION(hw_errormsg) { pval **arg1; - int id, type; + int link, type; hw_connection *ptr; char errstr[100]; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } - HW_FETCH_ID(arg1); + HW_FETCH_LINK(arg1); switch (ptr->lasterror) { case 0: