aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport/chttp2
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2016-07-25 14:45:41 -0700
committerGravatar GitHub <noreply@github.com>2016-07-25 14:45:41 -0700
commit01da196879cb69b3c56b3bdcff6f0194ab5a190d (patch)
tree766749fde4a5b74eabe1df92ebb3f65d0df70935 /src/core/ext/transport/chttp2
parentcc961b6c5a47622f8b14039f13d80d898a70b947 (diff)
parent1533e6aab9372d1f3eb667e6d4307eb2e1ee9b3f (diff)
Merge pull request #7508 from murgatroid99/v1.0.x_merge_into_master
V1.0.x merge into master
Diffstat (limited to 'src/core/ext/transport/chttp2')
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
index be8a8f8498..d050467a02 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c
@@ -2005,6 +2005,7 @@ static grpc_error *try_http_parsing(grpc_exec_ctx *exec_ctx,
static void parsing_action(grpc_exec_ctx *exec_ctx, void *arg,
grpc_error *error) {
grpc_chttp2_transport *t = arg;
+ grpc_error *err = GRPC_ERROR_NONE;
GPR_TIMER_BEGIN("reading_action.parse", 0);
size_t i = 0;
grpc_error *errors[3] = {GRPC_ERROR_REF(error), GRPC_ERROR_NONE,
@@ -2013,15 +2014,13 @@ static void parsing_action(grpc_exec_ctx *exec_ctx, void *arg,
errors[1] = grpc_chttp2_perform_read(exec_ctx, &t->parsing,
t->read_buffer.slices[i]);
};
- if (i != t->read_buffer.count) {
+ if (errors[1] == GRPC_ERROR_NONE) {
+ err = GRPC_ERROR_REF(error);
+ } else {
errors[2] = try_http_parsing(exec_ctx, t);
+ err = GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors,
+ GPR_ARRAY_SIZE(errors));
}
- grpc_error *err =
- errors[0] == GRPC_ERROR_NONE && errors[1] == GRPC_ERROR_NONE &&
- errors[2] == GRPC_ERROR_NONE
- ? GRPC_ERROR_NONE
- : GRPC_ERROR_CREATE_REFERENCING("Failed parsing HTTP/2", errors,
- GPR_ARRAY_SIZE(errors));
for (i = 0; i < GPR_ARRAY_SIZE(errors); i++) {
GRPC_ERROR_UNREF(errors[i]);
}