diff options
author | Craig Tiller <ctiller@google.com> | 2016-12-08 17:05:02 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-12-08 17:05:02 -0800 |
commit | 9e78d69fafd66334909f13cac1f3743a21c7ff55 (patch) | |
tree | cd942d2ec588f2fbf1ece089f530cc122d35dbbb /src/php/ext | |
parent | 3ba16e4f0562e32cfffb786c1d74e8e49bb5e6de (diff) |
Start converting php
Diffstat (limited to 'src/php/ext')
-rw-r--r-- | src/php/ext/grpc/call.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c index 3a49ea8708..85fb994afd 100644 --- a/src/php/ext/grpc/call.c +++ b/src/php/ext/grpc/call.c @@ -100,11 +100,11 @@ zval *grpc_parse_metadata_array(grpc_metadata_array grpc_metadata *elem; for (i = 0; i < count; i++) { elem = &elements[i]; - key_len = strlen(elem->key); + key_len = GRPC_SLICE_LENGTH(elem->key); str_key = ecalloc(key_len + 1, sizeof(char)); - memcpy(str_key, elem->key, key_len); - str_val = ecalloc(elem->value_length + 1, sizeof(char)); - memcpy(str_val, elem->value, elem->value_length); + memcpy(str_key, GRPC_SLICE_START_PTR(elem->key), key_len); + str_val = ecalloc(GRPC_SLICE_LENGTH(elem->value) + 1, sizeof(char)); + memcpy(str_val, GRPC_SLICE_START_PTR(elem->value), GRPC_SLICE_LENGTH(elem->value)); if (php_grpc_zend_hash_find(array_hash, str_key, key_len, (void **)&data) == SUCCESS) { if (Z_TYPE_P(data) != IS_ARRAY) { @@ -115,13 +115,13 @@ zval *grpc_parse_metadata_array(grpc_metadata_array efree(str_val); return NULL; } - php_grpc_add_next_index_stringl(data, str_val, elem->value_length, + php_grpc_add_next_index_stringl(data, str_val, GRPC_SLICE_LENGTH(elem->value), false); } else { PHP_GRPC_MAKE_STD_ZVAL(inner_array); array_init(inner_array); php_grpc_add_next_index_stringl(inner_array, str_val, - elem->value_length, false); + GRPC_SLICE_LENGTH(elem->value), false); add_assoc_zval(array, str_key, inner_array); } } |