|
|
@ -131,7 +131,7 @@ PyObject *pygrpc_Call_start_batch(Call *self, PyObject *args, PyObject *kwargs) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tag = pygrpc_produce_batch_tag(user_tag, self, ops, nops); |
|
|
|
tag = pygrpc_produce_batch_tag(user_tag, self, ops, nops); |
|
|
|
errcode = grpc_call_start_batch(self->c_call, tag->ops, tag->nops, tag); |
|
|
|
errcode = grpc_call_start_batch(self->c_call, tag->ops, tag->nops, tag, NULL); |
|
|
|
gpr_free(ops); |
|
|
|
gpr_free(ops); |
|
|
|
return PyInt_FromLong(errcode); |
|
|
|
return PyInt_FromLong(errcode); |
|
|
|
} |
|
|
|
} |
|
|
@ -151,13 +151,13 @@ PyObject *pygrpc_Call_cancel(Call *self, PyObject *args, PyObject *kwargs) { |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
code = PyInt_AsLong(py_code); |
|
|
|
code = PyInt_AsLong(py_code); |
|
|
|
errcode = grpc_call_cancel_with_status(self->c_call, code, details); |
|
|
|
errcode = grpc_call_cancel_with_status(self->c_call, code, details, NULL); |
|
|
|
} else if (py_code != NULL || details != NULL) { |
|
|
|
} else if (py_code != NULL || details != NULL) { |
|
|
|
PyErr_SetString(PyExc_ValueError, |
|
|
|
PyErr_SetString(PyExc_ValueError, |
|
|
|
"if `code` is specified, so must `details`"); |
|
|
|
"if `code` is specified, so must `details`"); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
errcode = grpc_call_cancel(self->c_call); |
|
|
|
errcode = grpc_call_cancel(self->c_call, NULL); |
|
|
|
} |
|
|
|
} |
|
|
|
return PyInt_FromLong(errcode); |
|
|
|
return PyInt_FromLong(errcode); |
|
|
|
} |
|
|
|
} |
|
|
|