From a25cbbc885ac77c2a2923c678a1cd0b87b90ef0e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 9 Dec 2016 09:32:10 -0800 Subject: Convert more of PHP --- src/php/ext/grpc/call.c | 9 +++------ 1 file 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; -- cgit v1.2.3