aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/http
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-05-09 13:14:32 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-05-09 13:14:32 -0700
commite6deeb1089988a5de5fdc64cf39d1b6fbc032af6 (patch)
treec38c8c4a01606f1126e8c8f5c14973f835a67917 /src/core/lib/http
parent6a64bfd982ea6dc7d09571bc875e789cdb7b3abe (diff)
Progress converting to new error system (HTTP fixes)
Diffstat (limited to 'src/core/lib/http')
-rw-r--r--src/core/lib/http/httpcli.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/lib/http/httpcli.c b/src/core/lib/http/httpcli.c
index 474a6eb8c1..4bda734bfa 100644
--- a/src/core/lib/http/httpcli.c
+++ b/src/core/lib/http/httpcli.c
@@ -141,12 +141,15 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
internal_request *req = user_data;
size_t i;
- GRPC_ERROR_REF(error);
-
- for (i = 0; error == GRPC_ERROR_NONE && i < req->incoming.count; i++) {
+ for (i = 0; i < req->incoming.count; i++) {
if (GPR_SLICE_LENGTH(req->incoming.slices[i])) {
req->have_read_byte = 1;
- error = grpc_http_parser_parse(&req->parser, req->incoming.slices[i]);
+ grpc_error *err =
+ grpc_http_parser_parse(&req->parser, req->incoming.slices[i]);
+ if (err != GRPC_ERROR_NONE) {
+ finish(exec_ctx, req, err);
+ return;
+ }
}
}
@@ -155,11 +158,8 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *user_data,
} else if (!req->have_read_byte) {
next_address(exec_ctx, req, GRPC_ERROR_REF(error));
} else {
- append_error(req, GRPC_ERROR_REF(error));
- finish(exec_ctx, req, error);
+ finish(exec_ctx, req, grpc_http_parser_eof(&req->parser));
}
-
- GRPC_ERROR_UNREF(error);
}
static void on_written(grpc_exec_ctx *exec_ctx, internal_request *req) {