From ec7839339d52491188776ca2bb05760cc3c8ad40 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 13 Jan 2012 14:09:16 -0800 Subject: [PATCH 1/2] Fix packaging. --- package.xml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/package.xml b/package.xml index 75e195e..0d9992d 100644 --- a/package.xml +++ b/package.xml @@ -15,9 +15,9 @@ http://pear.php.net/dtd/package-2.0.xsd"> andrei@php.net yes - 2012-01-12 + 2012-01-13 - 0.2.0 + 0.2.1 0.2.0 @@ -26,12 +26,9 @@ http://pear.php.net/dtd/package-2.0.xsd"> PHP -- Added session handler support -- Added connect() and delete methods -- Bug fixes +- Package up missed source files - @@ -42,6 +39,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + + + @@ -59,6 +61,15 @@ http://pear.php.net/dtd/package-2.0.xsd"> zookeeper + + betabeta + 0.2.10.2.0 + 2012-01-13 + +- Package up missed source files + + + betabeta 0.2.00.2.0 From 2d4b7bd09060eca1c90d174e077a32472ff01d14 Mon Sep 17 00:00:00 2001 From: Logan Reese Date: Mon, 30 Jan 2012 15:48:46 -0600 Subject: [PATCH 2/2] Allow paths larger than 255 characters. --- php_zookeeper.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/php_zookeeper.c b/php_zookeeper.c index ae6a0f0..09df853 100644 --- a/php_zookeeper.c +++ b/php_zookeeper.c @@ -189,8 +189,8 @@ static PHP_METHOD(Zookeeper, create) int path_len, value_len; zval *acl_info = NULL; long flags = 0; - char realpath[256]; - int realpath_max = 256; + char *realpath; + int realpath_max = 0; struct ACL_vector aclv = { 0, }; int status = ZOK; ZK_METHOD_INIT_VARS; @@ -202,15 +202,23 @@ static PHP_METHOD(Zookeeper, create) ZK_METHOD_FETCH_OBJECT; + realpath_max = path_len + 1; + if (flags & ZOO_SEQUENCE) { + // allocate extra space for sequence numbers + realpath_max += 11; + } + realpath = emalloc(realpath_max); + php_parse_acl_list(acl_info, &aclv); status = zoo_create(i_obj->zk, path, value, value_len, (acl_info ? &aclv : 0), flags, realpath, realpath_max); if (status != ZOK) { + efree(realpath); php_error_docref(NULL TSRMLS_CC, E_WARNING, "error: %s", zerror(status)); return; } - RETURN_STRING(realpath, 1); + RETURN_STRING(realpath, 0); } /* }}} */