forked fromglynos/cpp-netlib
- Notifications
You must be signed in to change notification settings - Fork425
Message refactor#631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Message refactor#631
Changes from1 commit
Commits
Show all changes
11 commits Select commitHold shift + click to select a range
858eea7 Added image to the license in README.rst.
glynos0187ec1 Removed some redundant headers.
glynos047d89c Added a first test in order to start refactoring the HTTP request/res…
glynos40bab67 Since I removed the include directory in a previous commit, I have no…
glynos175cdd3 Updated the examples that used the include directory that I removed.
glynos5614b43 Removed boost/network.hpp
glynos2f61e45 Fixed string constants.
glynos4c9fbda Added a unit tests for the HTTP client request.
glynos5f6ab56 Added a unit test for the HTTP client response.
glynos99c777c Removed some headers that looked redundant.
glynos1e14f3c Refactored HTTP client request and response.
glynosFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Removed some headers that looked redundant.
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit99c777c50172b9ab46726ed61707881b98688e1a
There are no files selected for viewing
75 changes: 0 additions & 75 deletionsboost/network/protocol/http/server/impl/parsers.ipp
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
51 changes: 0 additions & 51 deletionsboost/network/protocol/http/server/request.hpp
This file was deleted.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
59 changes: 55 additions & 4 deletionslibs/network/src/server_request_parsers_impl.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,61 @@ | ||
| // Copyright 2013 Google, Inc. | ||
| // Copyright 2010 Dean Michael Berris. | ||
| // Distributed under the Boost Software License, Version 1.0. | ||
| // (See accompanying file LICENSE_1_0.txt or copy at | ||
| // http://www.boost.org/LICENSE_1_0.txt) | ||
| #include <tuple> | ||
| #include <vector> | ||
| #define BOOST_SPIRIT_UNICODE | ||
| #include <boost/spirit/include/qi.hpp> | ||
| #include <boost/fusion/include/std_tuple.hpp> | ||
| #include <boost/network/protocol/http/message/header.hpp> | ||
| namespace boost { | ||
| namespace spirit { | ||
| namespace traits { | ||
| typedef std::basic_string<uint32_t> u32_string; | ||
| template <> // <typename Attrib, typename T, typename Enable> | ||
| struct assign_to_container_from_value<std::string, u32_string, void> { | ||
| static void call(u32_string const& val, std::string& attr) { | ||
| u32_to_u8_iterator<u32_string::const_iterator> begin = val.begin(), | ||
| end = val.end(); | ||
| for (; begin != end; ++begin) attr += *begin; | ||
| } | ||
| }; | ||
| } // namespace traits | ||
| } // namespace spirit | ||
| } // namespace boost | ||
| namespace boost { | ||
| namespace network { | ||
| namespace http { | ||
| void parse_version( | ||
| std::string const& partial_parsed, | ||
| std::tuple<std::uint8_t, std::uint8_t>& version_pair) { | ||
| using namespace boost::spirit::qi; | ||
| parse(partial_parsed.begin(), partial_parsed.end(), | ||
| (lit("HTTP/") >> ushort_ >> '.' >> ushort_), version_pair); | ||
| } | ||
| void parse_headers( | ||
| std::string const& input, std::vector<request_header_narrow>& container) { | ||
| using namespace boost::spirit::qi; | ||
| u8_to_u32_iterator<std::string::const_iterator> begin = input.begin(), | ||
| end = input.end(); | ||
| typedef as<boost::spirit::traits::u32_string> as_u32_string; | ||
| parse(begin, end, | ||
| *(+((alnum | punct) - ':') >> lit(": ") >> | ||
| as_u32_string()[+((unicode::alnum | space | punct) - '\r' - '\n')] >> | ||
| lit("\r\n")) >> | ||
| lit("\r\n"), | ||
| container); | ||
| } | ||
| } // namespace http | ||
| } // namespace network | ||
| } // namespace boost |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.