diff --git a/php_uv.c b/php_uv.c index 62a8fcd..e3ff92a 100644 --- a/php_uv.c +++ b/php_uv.c @@ -2147,8 +2147,7 @@ PHP_FUNCTION(uv_tcp_bind) ZEND_FETCH_RESOURCE(uv, php_uv_t *, &resource, -1, PHP_UV_RESOURCE_NAME, uv_resource_handle); ZEND_FETCH_RESOURCE(addr, php_uv_sockaddr_t *, &address, -1, PHP_UV_SOCKADDR_RESOURCE_NAME, uv_sockaddr_handle); - Z_ADDREF_P(resource); - +\ r = uv_tcp_bind((uv_tcp_t*)&uv->uv.tcp, addr->addr.ipv4); if (r) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "bind failed"); diff --git a/tests/300-uv_idle.phpt b/tests/101-uv-idle.phpt similarity index 100% rename from tests/300-uv_idle.phpt rename to tests/101-uv-idle.phpt diff --git a/tests/400-tcp_bind.phpt b/tests/400-tcp_bind.phpt new file mode 100644 index 0000000..58c258e --- /dev/null +++ b/tests/400-tcp_bind.phpt @@ -0,0 +1,32 @@ +--TEST-- +Check for tcp bind +--FILE-- +