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 2016/11/22 03:27:24 UTC
[04/13] mesos git commit: Moved around the `Request` struct in the
file.
Moved around the `Request` struct in the file.
This serves two purposes:
- This brings it near the `Response` struct thereby making it easy
to switch between them for readability.
- In the future, `Request` would have a `Pipe::Reader` member
for supporting request streaming. Otherwise, we would need to
add another forward declaration and forward declaring nested
structs is not quite possible.
Review: https://reviews.apache.org/r/53481/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6a4de740
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6a4de740
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6a4de740
Branch: refs/heads/master
Commit: 6a4de74007604862e3c24b022ab565c8a9c6cdc9
Parents: 69efd9a
Author: Anand Mazumdar <an...@apache.org>
Authored: Mon Nov 21 18:07:06 2016 -0800
Committer: Anand Mazumdar <an...@apache.org>
Committed: Mon Nov 21 19:27:08 2016 -0800
----------------------------------------------------------------------
3rdparty/libprocess/include/process/http.hpp | 78 +++++++++++------------
1 file changed, 39 insertions(+), 39 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/6a4de740/3rdparty/libprocess/include/process/http.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/http.hpp b/3rdparty/libprocess/include/process/http.hpp
index 9722c62..5f7c0f6 100644
--- a/3rdparty/libprocess/include/process/http.hpp
+++ b/3rdparty/libprocess/include/process/http.hpp
@@ -257,45 +257,6 @@ typedef hashmap<std::string,
CaseInsensitiveEqual> Headers;
-struct Request
-{
- std::string method;
-
- // TODO(benh): Add major/minor version.
-
- // For client requests, the URL should be a URI.
- // For server requests, the URL may be a URI or a relative reference.
- URL url;
-
- Headers headers;
-
- // TODO(bmahler): Add a 'query' field which contains both
- // the URL query and the parsed form data from the body.
-
- std::string body;
-
- // TODO(bmahler): Ensure this is consistent with the 'Connection'
- // header; perhaps make this a function that checks the header.
- bool keepAlive;
-
- // For server requests, this contains the address of the client.
- // Note that this may correspond to a proxy or load balancer address.
- network::Address client;
-
- /**
- * Returns whether the encoding is considered acceptable in the
- * response. See RFC 2616 section 14.3 for details.
- */
- bool acceptsEncoding(const std::string& encoding) const;
-
- /**
- * Returns whether the media type is considered acceptable in the
- * response. See RFC 2616, section 14.1 for the details.
- */
- bool acceptsMediaType(const std::string& mediaType) const;
-};
-
-
// Represents an asynchronous in-memory unbuffered Pipe, currently
// used for streaming HTTP responses via chunked encoding. Note that
// being an in-memory pipe means that this cannot be used across OS
@@ -450,6 +411,45 @@ private:
};
+struct Request
+{
+ std::string method;
+
+ // TODO(benh): Add major/minor version.
+
+ // For client requests, the URL should be a URI.
+ // For server requests, the URL may be a URI or a relative reference.
+ URL url;
+
+ Headers headers;
+
+ // TODO(bmahler): Add a 'query' field which contains both
+ // the URL query and the parsed form data from the body.
+
+ std::string body;
+
+ // TODO(bmahler): Ensure this is consistent with the 'Connection'
+ // header; perhaps make this a function that checks the header.
+ bool keepAlive;
+
+ // For server requests, this contains the address of the client.
+ // Note that this may correspond to a proxy or load balancer address.
+ network::Address client;
+
+ /**
+ * Returns whether the encoding is considered acceptable in the
+ * response. See RFC 2616 section 14.3 for details.
+ */
+ bool acceptsEncoding(const std::string& encoding) const;
+
+ /**
+ * Returns whether the media type is considered acceptable in the
+ * response. See RFC 2616, section 14.1 for the details.
+ */
+ bool acceptsMediaType(const std::string& mediaType) const;
+};
+
+
struct Response
{
Response()