aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
diff options
context:
space:
mode:
authorGravatar Masood Malekghassemi <atash@google.com>2016-12-07 19:37:01 -0800
committerGravatar Masood Malekghassemi <atash@google.com>2016-12-07 19:37:01 -0800
commit990983110f0c2e948ab23289f994876f1e0f565f (patch)
treec29768a25b5109efd4f766df06220e650d5c8463 /src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
parent3153e5af0cda0755d927f281f6561eb52279ced1 (diff)
Begin patching Cython
Diffstat (limited to 'src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi')
-rw-r--r--src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
index 73d1ff7b97..e4c24a83ab 100644
--- a/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
+++ b/src/python/grpcio/grpc/_cython/_cygrpc/channel.pyx.pxi
@@ -60,19 +60,23 @@ cdef class Channel:
method, host, Timespec deadline not None):
if queue.is_shutting_down:
raise ValueError("queue must not be shutting down or shutdown")
- cdef char *method_c_string = method
- cdef char *host_c_string = NULL
+ cdef Slice method_slice = Slice.from_bytes(method)
+ cdef Slice host_slice
+ cdef grpc_slice *host_c_slice = NULL
if host is not None:
- host_c_string = host
+ host_slice = Slice.from_bytes(host)
+ host_c_slice = &host_slice.c_slice
+ else:
+ host_slice = Slice()
cdef Call operation_call = Call()
- operation_call.references = [self, method, host, queue]
+ operation_call.references = [self, method_slice, host_slice, queue]
cdef grpc_call *parent_call = NULL
if parent is not None:
parent_call = parent.c_call
with nogil:
operation_call.c_call = grpc_channel_create_call(
self.c_channel, parent_call, flags,
- queue.c_completion_queue, method_c_string, host_c_string,
+ queue.c_completion_queue, method_slice.c_slice, host_c_slice,
deadline.c_time, NULL)
return operation_call