You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by an...@apache.org on 2017/04/21 17:00:12 UTC
[3/3] mesos git commit: Marked decoder as failed when
request/response parsing failed.
Marked decoder as failed when request/response parsing failed.
Review: https://reviews.apache.org/r/58580/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/459873a2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/459873a2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/459873a2
Branch: refs/heads/1.2.x
Commit: 459873a26279162cdcb4a47d5bf8f4b0984d2ccb
Parents: 8d847ec
Author: Anindya Sinha <an...@apple.com>
Authored: Fri Apr 21 09:44:04 2017 -0700
Committer: Anand Mazumdar <an...@apache.org>
Committed: Fri Apr 21 09:59:48 2017 -0700
----------------------------------------------------------------------
3rdparty/libprocess/src/decoder.hpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/459873a2/3rdparty/libprocess/src/decoder.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/decoder.hpp b/3rdparty/libprocess/src/decoder.hpp
index 4c779d4..a026d16 100644
--- a/3rdparty/libprocess/src/decoder.hpp
+++ b/3rdparty/libprocess/src/decoder.hpp
@@ -205,6 +205,7 @@ private:
http_parser_parse_url(decoder->url.data(), decoder->url.size(), 0, &url);
if (parse_url != 0) {
+ decoder->failure = true;
return parse_url;
}
@@ -231,6 +232,7 @@ private:
http::query::decode(decoder->query);
if (decoded.isError()) {
+ decoder->failure = true;
return 1;
}
@@ -242,6 +244,7 @@ private:
if (encoding.isSome() && encoding.get() == "gzip") {
Try<std::string> decompressed = gzip::decompress(decoder->request->body);
if (decompressed.isError()) {
+ decoder->failure = true;
return 1;
}
decoder->request->body = decompressed.get();
@@ -435,7 +438,6 @@ private:
http::Status::string(decoder->parser.status_code);
} else {
decoder->failure = true;
-
return 1;
}
@@ -666,7 +668,6 @@ private:
http::Status::string(decoder->parser.status_code);
} else {
decoder->failure = true;
-
return 1;
}
@@ -919,6 +920,7 @@ private:
http_parser_parse_url(decoder->url.data(), decoder->url.size(), 0, &url);
if (parse_url != 0) {
+ decoder->failure = true;
return parse_url;
}
@@ -945,6 +947,7 @@ private:
http::query::decode(decoder->query);
if (decoded.isError()) {
+ decoder->failure = true;
return 1;
}
@@ -986,6 +989,7 @@ private:
decoder->decompressor->decompress(std::string(data, length));
if (decompressed.isError()) {
+ decoder->failure = true;
return 1;
}
@@ -1010,6 +1014,7 @@ private:
if (decoder->decompressor.get() != nullptr &&
!decoder->decompressor->finished()) {
writer.fail("Failed to decompress body");
+ decoder->failure = true;
return 1;
}