- Notifications
You must be signed in to change notification settings - Fork425
Fix for issue #419#446
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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,6 +2,7 @@ | ||
| #define BOOST_NETWORK_PROTOCOL_HTTP_ALGORITHMS_LINEARIZE_HPP_20101028 | ||
| // Copyright 2010 Dean Michael Berris. | ||
| // Copyright 2014 Jussi Lyytinen | ||
| // 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) | ||
| @@ -137,7 +138,7 @@ BOOST_CONCEPT_REQUIRES(((ClientRequest<Request>)), (OutputIterator)) | ||
| *oi = consts::colon_char(); | ||
| *oi = consts::space_char(); | ||
| boost::copy(request.host(), oi); | ||
| boost::optional<boost::uint16_t> port_ = port(request).as_optional(); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This one in particular you may want to wrap in something like this: | ||
| if (port_) { | ||
| string_type port_str = boost::lexical_cast<string_type>(*port_); | ||
| *oi = consts::colon_char(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4,6 +4,7 @@ | ||
| // Copyright 2010, 2014 Dean Michael Berris <dberris@google.com> | ||
| // Copyright 2010 (c) Sinefunc, Inc. | ||
| // Copyright 2014 Google, Inc. | ||
| // Copyright 2014 Jussi Lyytinen | ||
| // 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) | ||
| @@ -31,23 +32,20 @@ struct port_wrapper { | ||
| operator port_type() const { return message_.port(); } | ||
| #if !defined(_MSC_VER) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I'm not quite sure this is what we want. Checking that the version is above a certain threshold would be preferred, in my opinion. Something like: Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Let's do that then. I deliberately did it this way though so that users would have the option not to use conditional directives in their code and instead just use the explicit conversion. | ||
| // Because of a breaking change in Boost 1.56 to boost::optional, implicit | ||
| // conversions no longer work correctly with MSVC. The conversion therefore | ||
| // has to be done explicitly with as_optional(). This method is here just | ||
| // to maintain backwards compatibility with compilers not affected by the | ||
| // change. | ||
| operator boost::optional<boost::uint16_t>() const { | ||
| return uri::port_us(message_.uri()); | ||
| } | ||
| #endif | ||
| boost::optional<boost::uint16_t> as_optional() const { | ||
| return uri::port_us(message_.uri()); | ||
| } | ||
| }; | ||