From 293ee92791f5cbdcbd70bf5f8c3eac1166ed0b07 Mon Sep 17 00:00:00 2001 From: Andrew Bevitt Date: Thu, 10 Jul 2014 00:11:19 +1000 Subject: [PATCH] Add cache length parameter to the parameter parsing. --- plugins/php/php_plugin.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/php/php_plugin.c b/plugins/php/php_plugin.c index c2767955..7a4e4b06 100644 --- a/plugins/php/php_plugin.c +++ b/plugins/php/php_plugin.c @@ -254,8 +254,9 @@ PHP_FUNCTION(uwsgi_cache_exists) { char *key = NULL; int keylen = 0; char *cache = NULL; + int cachelen = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) { RETURN_NULL(); } @@ -269,8 +270,9 @@ PHP_FUNCTION(uwsgi_cache_exists) { PHP_FUNCTION(uwsgi_cache_clear) { char *cache = NULL; + int cachelen = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &cache, &cachelen) == FAILURE) { RETURN_NULL(); } @@ -287,8 +289,9 @@ PHP_FUNCTION(uwsgi_cache_del) { char *key = NULL; int keylen = 0; char *cache = NULL; + int cachelen = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) { RETURN_NULL(); } @@ -304,12 +307,13 @@ PHP_FUNCTION(uwsgi_cache_get) { char *key = NULL; int keylen = 0; char *cache = NULL; + int cachelen = 0; uint64_t valsize; if (!uwsgi.caches) RETURN_NULL(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &key, &keylen, &cache, &cachelen) == FAILURE) { RETURN_NULL(); } @@ -329,11 +333,12 @@ PHP_FUNCTION(uwsgi_cache_set) { int vallen; uint64_t expires = 0; char *cache = NULL; + int cachelen = 0; if (!uwsgi.caches) RETURN_NULL(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) { RETURN_NULL(); } @@ -351,11 +356,12 @@ PHP_FUNCTION(uwsgi_cache_update) { int vallen; uint64_t expires = 0; char *cache = NULL; + int cachelen = 0; if (!uwsgi.caches) RETURN_NULL(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|ls", &key, &keylen, &value, &vallen, &expires, &cache, &cachelen) == FAILURE) { RETURN_NULL(); }