Cool, thanks for the detailed explanation!
Can you prepare a pull request to the official repository with your changes?
Glyn is currently in charge of the URI implementation but if you can
write tests that manifest the errors and these changes, I'm positive
he'll merge in your changes when he gets around to reviewing them.
You can find out how to do this easily from here:
http://help.github.com/send-pull-requests/
Cheers
--
Dean Michael Berris
Technical Solutions Engineer
Google
Hi,
When I tried to run a basic example:
http::client client;
http::client::request request("http://www.google.com");
request << header("Connection", "close");
http::client::response response = client.get(request);
std::cout << body(response) << std::endl;
I got an assert error: "string iterators incompatible" as several
others have already got before me (MSVC), but I did some research. The
error occurs when when this code is invoked:
string_type query() const {
const_range_type range = query_range();
return string_type(boost::begin(range), boost::end(range));
}
In file "boost/network/uri/uri.hpp" on line 156.
The problem occurs because the method query_range returns a default
constructed const_range_type sometimes:
const_range_type query_range() const {
return uri_parts_.query ? uri_parts_.query.get() :
const_range_type(); //last line is illegal if
//any attempt to compare the iterator are made with the return value,
the iterator is singular
}
Thanks in advance and for a great attempt to create a simple network
library.
Hi,
I'm seeing this same behavior with the cpp-netlib 0.10.1 version (i.e., boost 1.54, windows 7 64bit, visual studio profesional 10). Same error in Debug build, works fine in Release.
I'm aware of bugs of this nature in the 0.x releases. It means they haven't been tested thorougly on MSVC. These problems don't appear in the 1.x version. So it seems there are 3 options:1. backport the URI in the 1.x branch to the 0.x branch, removing all C++11 features2. Maintain 0.x and 1.x versions in parallel3. Tolerate bugs in 0.xI think the bug you describe is fundamental (internally, it's actually undefined behaviour, and we can't rely on the fact that it just seems to work on most platforms), therefore 3 is not an option. 1. is impractical, as the 1.x URI relies heavily on new C++11 library features (e.g. std::system_error) and backporting will not be trivial. 2. is therefore the least worst option.I've added an issue (https://github.com/cpp-netlib/cpp-netlib/issues/275) and I'll address it in the next days/weeks.
--
You received this message because you are subscribed to the Google Groups "The C++ Network Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpp-netlib+...@googlegroups.com.
To post to this group, send email to cpp-n...@googlegroups.com.
Visit this group at http://groups.google.com/group/cpp-netlib.
For more options, visit https://groups.google.com/d/optout.
I'd be happy to review a pull request, and would appreciate it very much.
--
Like Glyn mentioned, we have options here.Personally, I like the idea of just using C++11 features in the 0.11-devel branch anyway, and having a 0.12-devel branch cut to just required C++11 features as a minimum, when we're ready to do another release.I think Glyn has fixed a lot of these issues in the cpp-netlib/uri implementation, and that we should just use that implementation moving forward.