Skip to content

moar tests passing #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 1, 2015
Prev Previous commit
Next Next commit
down to four failures ...
  • Loading branch information
krakjoe committed Aug 31, 2015
commit 20636b2ae39a9c17d0e5b955770746a82b2bf4bb
13 changes: 7 additions & 6 deletions php_memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -3582,6 +3582,7 @@ static memcached_return php_memc_do_cache_callback(zval *zmemc_obj, zend_fcall_i
zval_ptr_dtor(&z_key);
zval_ptr_dtor(&z_val);
zval_ptr_dtor(&z_expiration);
zval_ptr_dtor(zmemc_obj);

return status;
}
Expand All @@ -3603,9 +3604,7 @@ static int php_memc_do_result_callback(zval *zmemc_obj, zend_fcall_info *fci,
int rc = 0;
php_memc_t *i_obj = NULL;

ZVAL_COPY(&params[0], zmemc_obj);
fci->retval = &retval;
fci->params = params;
fci->param_count = 2;

payload = memcached_result_value(result);
Expand All @@ -3624,7 +3623,6 @@ static int php_memc_do_result_callback(zval *zmemc_obj, zend_fcall_info *fci,
}

array_init(&z_result);
ZVAL_COPY(&params[1], &z_result);
add_assoc_stringl_ex(&z_result, ZEND_STRL("key"), (char *)res_key, res_key_len);
add_assoc_zval_ex(&z_result, ZEND_STRL("value"), &value);
if (cas != 0) {
Expand All @@ -3634,16 +3632,19 @@ static int php_memc_do_result_callback(zval *zmemc_obj, zend_fcall_info *fci,
add_assoc_long_ex(&z_result, ZEND_STRL("flags"), MEMC_VAL_GET_USER_FLAGS(flags));
}

ZVAL_UNDEF(&retval);
zend_fcall_info_argn(fci, 2, zmemc_obj, &z_result);

if (zend_call_function(fci, fcc) == FAILURE) {
php_error_docref(NULL, E_WARNING, "could not invoke result callback");
rc = -1;
}

if (&retval) {
if (Z_TYPE(retval) != IS_UNDEF) {
zval_ptr_dtor(&retval);
}
zval_ptr_dtor(&params[0]);
zval_ptr_dtor(&params[1]);

zend_fcall_info_args_clear(fci, 1);
zval_ptr_dtor(&z_result);

return rc;
Expand Down