diff options
author | Craig Tiller <ctiller@google.com> | 2016-12-09 09:32:10 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-12-09 09:32:10 -0800 |
commit | a25cbbc885ac77c2a2923c678a1cd0b87b90ef0e (patch) | |
tree | 98025918a1a8fe06069b09d781eb2a86af53db52 | |
parent | 3bfb00486aee85081b34fe1391704fdf5207f384 (diff) |
Convert more of PHP
-rw-r--r-- | src/php/ext/grpc/call.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 1b963f2dbe..736738c8e0 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -271,8 +271,7 @@ PHP_METHOD(Call, startBatch) { grpc_metadata_array recv_metadata; grpc_metadata_array recv_trailing_metadata; grpc_status_code status; - char *status_details = NULL; - size_t status_details_capacity = 0; + grpc_slice status_details; grpc_byte_buffer *message; int cancelled; grpc_call_error error; @@ -384,8 +383,8 @@ PHP_METHOD(Call, startBatch) { 1 TSRMLS_CC); goto cleanup; } - ops[op_num].data.send_status_from_server.status_details = - Z_STRVAL_P(inner_value); + grpc_slice send_status_details = grpc_slice_from_copied_string(Z_STRVAL_P(inner_value)); + ops[op_num].data.send_status_from_server.status_details = &send_status_details; } else { zend_throw_exception(spl_ce_InvalidArgumentException, "String status details is required", @@ -405,8 +404,6 @@ PHP_METHOD(Call, startBatch) { ops[op_num].data.recv_status_on_client.status = &status; ops[op_num].data.recv_status_on_client.status_details = &status_details; - ops[op_num].data.recv_status_on_client.status_details_capacity = - &status_details_capacity; break; case GRPC_OP_RECV_CLOSE_ON_SERVER: ops[op_num].data.recv_close_on_server.cancelled = &cancelled; |