Added support for trailing metadata, fixed status support
Change on 2014/12/16 by mlumish <mlumish@google.com> ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=82239977
This commit is contained in:
parent
c99774fc7b
commit
a7baac5280
|
|
@ -376,12 +376,12 @@ PHP_METHOD(Call, start_write_status){
|
|||
long status_code;
|
||||
int status_details_length;
|
||||
long tag;
|
||||
grpc_status status;
|
||||
char *status_details;
|
||||
/* "lsl" == 1 long, 1 string, 1 long */
|
||||
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
|
||||
"lsl",
|
||||
&status_code,
|
||||
&status.details, &status_details_length,
|
||||
&status_details, &status_details_length,
|
||||
&tag) == FAILURE){
|
||||
zend_throw_exception(
|
||||
spl_ce_InvalidArgumentException,
|
||||
|
|
@ -389,9 +389,9 @@ PHP_METHOD(Call, start_write_status){
|
|||
1 TSRMLS_CC);
|
||||
return;
|
||||
}
|
||||
status.code = (gpr_uint32)status_code;
|
||||
RETURN_LONG(grpc_call_start_write_status(call->wrapped,
|
||||
status,
|
||||
(grpc_status_code)status_code,
|
||||
status_details,
|
||||
(void*)tag));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ PHP_METHOD(Event, get_data){
|
|||
case GRPC_FINISHED:
|
||||
MAKE_STD_ZVAL(retval);
|
||||
object_init(retval);
|
||||
add_property_long(retval, "code", event->data.finished.code);
|
||||
add_property_long(retval, "code", event->data.finished.status);
|
||||
if(event->data.finished.details == NULL){
|
||||
add_property_null(retval, "details");
|
||||
} else {
|
||||
|
|
@ -142,6 +142,9 @@ PHP_METHOD(Event, get_data){
|
|||
detail_string,
|
||||
true);
|
||||
}
|
||||
add_property_zval(retval, "metadata", grpc_call_create_metadata_array(
|
||||
event->data.finished.metadata_count,
|
||||
event->data.finished.metadata_elements));
|
||||
break;
|
||||
case GRPC_SERVER_RPC_NEW:
|
||||
MAKE_STD_ZVAL(retval);
|
||||
|
|
|
|||
|
|
@ -87,8 +87,8 @@ class ActiveCall {
|
|||
|
||||
/**
|
||||
* Wait for the server to send the status, and return it.
|
||||
* @return object The status object, with integer $code and string $details
|
||||
* members
|
||||
* @return object The status object, with integer $code, string $details,
|
||||
* and array $metadata members
|
||||
*/
|
||||
public function getStatus() {
|
||||
$status_event = $this->completion_queue->pluck(FINISHED,
|
||||
|
|
|
|||
Loading…
Reference in New Issue