mirror of https://github.com/grpc/grpc-web.git
grpc update
This commit is contained in:
parent
b1b345a5c6
commit
8aa8ce9039
|
|
@ -15,7 +15,7 @@ GrpcDecoder::GrpcDecoder()
|
|||
GrpcDecoder::~GrpcDecoder() {}
|
||||
|
||||
Status GrpcDecoder::Decode() {
|
||||
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
|
||||
grpc_core::ExecCtx exec_ctx;
|
||||
for (const Slice& slice : *inputs()) {
|
||||
if (slice.size() == 0) {
|
||||
continue;
|
||||
|
|
@ -32,7 +32,7 @@ Status GrpcDecoder::Decode() {
|
|||
Status status(StatusCode::INVALID_ARGUMENT,
|
||||
Format("Receives invalid compressed flag: %c.", c));
|
||||
DEBUG("%s", status.error_message().c_str());
|
||||
grpc_exec_ctx_finish(&exec_ctx);
|
||||
|
||||
return status;
|
||||
}
|
||||
compressed_flag_ = c;
|
||||
|
|
@ -85,11 +85,11 @@ Status GrpcDecoder::Decode() {
|
|||
grpc_slice_buffer output;
|
||||
grpc_slice_buffer_init(&output);
|
||||
if (grpc_msg_decompress(
|
||||
&exec_ctx, grpc_compression_algorithm::GRPC_COMPRESS_GZIP,
|
||||
&input, &output) != 1) {
|
||||
grpc_compression_algorithm::GRPC_COMPRESS_GZIP, &input,
|
||||
&output) != 1) {
|
||||
grpc_slice_buffer_destroy(&input);
|
||||
grpc_slice_buffer_destroy(&output);
|
||||
grpc_exec_ctx_finish(&exec_ctx);
|
||||
|
||||
return Status(StatusCode::INTERNAL,
|
||||
"Failed to uncompress the GRPC data frame.");
|
||||
}
|
||||
|
|
@ -115,7 +115,7 @@ Status GrpcDecoder::Decode() {
|
|||
}
|
||||
}
|
||||
inputs()->clear();
|
||||
grpc_exec_ctx_finish(&exec_ctx);
|
||||
|
||||
return Status::OK;
|
||||
}
|
||||
} // namespace gateway
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ GrpcEventQueue::~GrpcEventQueue() {}
|
|||
void GrpcEventQueue::Start() {
|
||||
gpr_thd_options thread_options = gpr_thd_options_default();
|
||||
gpr_thd_options_set_joinable(&thread_options);
|
||||
int ret = gpr_thd_new(&thread_id_, ExecuteEventLoop, this, &thread_options);
|
||||
int ret = gpr_thd_new(&thread_id_, "grpc_event_queue", ExecuteEventLoop, this,
|
||||
&thread_options);
|
||||
INFO("GRPC event thread started: %d", ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue