php: expose per-call host override option, review feedback

pull/2998/head
Stanley Cheung 10 years ago
parent 478fb00a2c
commit ddb16a8436
  1. 12
      src/php/ext/grpc/call.c
  2. 3
      src/php/ext/grpc/channel.c
  3. 1
      src/php/ext/grpc/channel.h

@ -244,15 +244,9 @@ PHP_METHOD(Call, __construct) {
wrapped_grpc_timeval *deadline = wrapped_grpc_timeval *deadline =
(wrapped_grpc_timeval *)zend_object_store_get_object( (wrapped_grpc_timeval *)zend_object_store_get_object(
deadline_obj TSRMLS_CC); deadline_obj TSRMLS_CC);
if (host_override != NULL) { call->wrapped = grpc_channel_create_call(
call->wrapped = grpc_channel_create_call( channel->wrapped, NULL, GRPC_PROPAGATE_DEFAULTS, completion_queue, method,
channel->wrapped, NULL, GRPC_PROPAGATE_DEFAULTS, completion_queue, method, host_override, deadline->wrapped, NULL);
host_override, deadline->wrapped, NULL);
} else {
call->wrapped = grpc_channel_create_call(
channel->wrapped, NULL, GRPC_PROPAGATE_DEFAULTS, completion_queue, method,
NULL, deadline->wrapped, NULL);
}
} }
/** /**

@ -64,7 +64,6 @@ void free_wrapped_grpc_channel(void *object TSRMLS_DC) {
if (channel->wrapped != NULL) { if (channel->wrapped != NULL) {
grpc_channel_destroy(channel->wrapped); grpc_channel_destroy(channel->wrapped);
} }
efree(channel->target);
efree(channel); efree(channel);
} }
@ -174,8 +173,6 @@ PHP_METHOD(Channel, __construct) {
} }
efree(args.args); efree(args.args);
} }
channel->target = ecalloc(target_length + 1, sizeof(char));
memcpy(channel->target, target, target_length);
} }
/** /**

@ -53,7 +53,6 @@ typedef struct wrapped_grpc_channel {
zend_object std; zend_object std;
grpc_channel *wrapped; grpc_channel *wrapped;
char *target;
} wrapped_grpc_channel; } wrapped_grpc_channel;
/* Initializes the Channel class */ /* Initializes the Channel class */

Loading…
Cancel
Save