|
|
|
@ -120,6 +120,8 @@ PHP_METHOD(CallCredentials, createFromPlugin) { |
|
|
|
|
fci->params, fci->param_count) == FAILURE) { |
|
|
|
|
zend_throw_exception(spl_ce_InvalidArgumentException, |
|
|
|
|
"createFromPlugin expects 1 callback", 1 TSRMLS_CC); |
|
|
|
|
free(fci); |
|
|
|
|
free(fci_cache); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -183,15 +185,17 @@ int plugin_get_metadata( |
|
|
|
|
*status = GRPC_STATUS_OK; |
|
|
|
|
*error_details = NULL; |
|
|
|
|
|
|
|
|
|
bool should_return = false; |
|
|
|
|
grpc_metadata_array metadata; |
|
|
|
|
|
|
|
|
|
if (retval == NULL || Z_TYPE_P(retval) != IS_ARRAY) { |
|
|
|
|
*status = GRPC_STATUS_INVALID_ARGUMENT; |
|
|
|
|
return true; // Synchronous return.
|
|
|
|
|
should_return = true; // Synchronous return.
|
|
|
|
|
} |
|
|
|
|
if (!create_metadata_array(retval, &metadata)) { |
|
|
|
|
*status = GRPC_STATUS_INVALID_ARGUMENT; |
|
|
|
|
return true; // Synchronous return.
|
|
|
|
|
should_return = true; // Synchronous return.
|
|
|
|
|
grpc_php_metadata_array_destroy_including_entries(&metadata); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (retval != NULL) { |
|
|
|
@ -204,6 +208,9 @@ int plugin_get_metadata( |
|
|
|
|
PHP_GRPC_FREE_STD_ZVAL(retval); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
if (should_return) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (metadata.count > GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX) { |
|
|
|
|
*status = GRPC_STATUS_INTERNAL; |
|
|
|
|