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() {}
|
GrpcDecoder::~GrpcDecoder() {}
|
||||||
|
|
||||||
Status GrpcDecoder::Decode() {
|
Status GrpcDecoder::Decode() {
|
||||||
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
|
grpc_core::ExecCtx exec_ctx;
|
||||||
for (const Slice& slice : *inputs()) {
|
for (const Slice& slice : *inputs()) {
|
||||||
if (slice.size() == 0) {
|
if (slice.size() == 0) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -32,7 +32,7 @@ Status GrpcDecoder::Decode() {
|
||||||
Status status(StatusCode::INVALID_ARGUMENT,
|
Status status(StatusCode::INVALID_ARGUMENT,
|
||||||
Format("Receives invalid compressed flag: %c.", c));
|
Format("Receives invalid compressed flag: %c.", c));
|
||||||
DEBUG("%s", status.error_message().c_str());
|
DEBUG("%s", status.error_message().c_str());
|
||||||
grpc_exec_ctx_finish(&exec_ctx);
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
compressed_flag_ = c;
|
compressed_flag_ = c;
|
||||||
|
|
@ -85,11 +85,11 @@ Status GrpcDecoder::Decode() {
|
||||||
grpc_slice_buffer output;
|
grpc_slice_buffer output;
|
||||||
grpc_slice_buffer_init(&output);
|
grpc_slice_buffer_init(&output);
|
||||||
if (grpc_msg_decompress(
|
if (grpc_msg_decompress(
|
||||||
&exec_ctx, grpc_compression_algorithm::GRPC_COMPRESS_GZIP,
|
grpc_compression_algorithm::GRPC_COMPRESS_GZIP, &input,
|
||||||
&input, &output) != 1) {
|
&output) != 1) {
|
||||||
grpc_slice_buffer_destroy(&input);
|
grpc_slice_buffer_destroy(&input);
|
||||||
grpc_slice_buffer_destroy(&output);
|
grpc_slice_buffer_destroy(&output);
|
||||||
grpc_exec_ctx_finish(&exec_ctx);
|
|
||||||
return Status(StatusCode::INTERNAL,
|
return Status(StatusCode::INTERNAL,
|
||||||
"Failed to uncompress the GRPC data frame.");
|
"Failed to uncompress the GRPC data frame.");
|
||||||
}
|
}
|
||||||
|
|
@ -115,7 +115,7 @@ Status GrpcDecoder::Decode() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inputs()->clear();
|
inputs()->clear();
|
||||||
grpc_exec_ctx_finish(&exec_ctx);
|
|
||||||
return Status::OK;
|
return Status::OK;
|
||||||
}
|
}
|
||||||
} // namespace gateway
|
} // namespace gateway
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ GrpcEventQueue::~GrpcEventQueue() {}
|
||||||
void GrpcEventQueue::Start() {
|
void GrpcEventQueue::Start() {
|
||||||
gpr_thd_options thread_options = gpr_thd_options_default();
|
gpr_thd_options thread_options = gpr_thd_options_default();
|
||||||
gpr_thd_options_set_joinable(&thread_options);
|
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);
|
INFO("GRPC event thread started: %d", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue