Giter Club home page Giter Club logo

cpp-netlib's Introduction

C++ Network Library

Modern C++ network programming libraries.

image

image

image

Join us on Slack: http://slack.cpp-netlib.org/

Subscribe to the mailing list: https://groups.google.com/forum/#!forum/cpp-netlib

Downloading cpp-netlib

You can find official release packages of the library at:

http://github.com/cpp-netlib/cpp-netlib/downloads

If you want the latest code from the master branch of the project, you can follow these instructions for cloning the project repository:

$ git clone https://github.com/cpp-netlib/cpp-netlib
$ cd cpp-netlib
$ git submodule init
$ git submodule update

Introduction

cpp-netlib is a collection of network-related routines/implementations geared towards providing a robust cross-platform networking library. cpp-netlib offers the following implementations:

  • Common Message Type -- A generic message type which can be used to encapsulate and store message-related information, used by all network implementations as the primary means of data exchange.
  • Network protocol message parsers -- A collection of parsers which generate message objects from strings.
  • Adapters and Wrappers -- A collection of Adapters and wrappers aimed towards making the message type STL friendly.
  • Network protocol client and server implementations -- A collection of network protocol implementations that include embeddable client and server types.

This library is released under the Boost Software License (please see http://boost.org/LICENSE_1_0.txt or the accompanying LICENSE_1_0.txt file for the full text.

Building and Installing

To build the libraries you will need to have CMake version 2.8 or higher installed appropriately in your system.

$ cmake --version
cmake version 2.8.1

It is recommended that you build cpp-netlib outside of the source directory, to avoid having issues with CMake generated files polluting the source directory:

$ mkdir ~/cpp-netlib-build
$ cd ~/cpp-netlib-build
$ cmake -DCMAKE_BUILD_TYPE=Debug     \
>       -DCMAKE_C_COMPILER=clang     \
>       -DCMAKE_CXX_COMPILER=clang++ \
>       $HOME/cpp-netlib    # we're assuming this is where cpp-netlib is.

Once CMake is done with generating the Makefiles and configuring the project, you can now build the tests and run them:

$ cd ~/cpp-netlib-build
$ make
$ make test

You can also download and install cpp-netlib using the vcpkg dependency manager:

$ git clone https://github.com/Microsoft/vcpkg.git $ cd vcpkg $ ./bootstrap-vcpkg.sh $ ./vcpkg integrate install $ vcpkg install cpp-netlib

The cpp-netlib port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

If for some reason some of the tests fail, you can send the files in Testing/Temporary/ as attachments to the cpp-netlib developers mailing list.

Running Tests

If you want to run the tests that come with cpp-netlib, there are a few things you will need. These are:

  • A compiler (GCC 4.x, Clang 3.6, MSVC 2008)
  • A build tool (CMake is required)
  • OpenSSL headers (optional)

Note

This assumes that you have cpp-netlib at the top-level of your home directory.

Hacking on cpp-netlib

cpp-netlib uses git for tracking work and is hosted on GitHub. cpp-netlib is hosted on GitHub following the GitHub recommended practice of forking the repository and submitting pull requests to the source repository. You can read more about the forking process and submitting pull requests if you're not familiar with either process yet. cpp-netib follows the GitHub pull request model for accepting patches. You can read more about the process at http://cpp-netlib.org/process.html#pull-requests.

Because cpp-netlib is released under the Boost Software License it is recommended that any file you make changes to bear your copyright notice alongside the original authors' copyright notices on the file. Typically the copyright notices are at the top of each file in the project.

You can read about the cpp-netlib style guide at http://cpp-netlib.org/style-guide.html.

The main "upstream" repository is at http://github.com/cpp-netlib/cpp-netlib.

Contact and Support

In case you have any questions or would like to make feature requests, you can contact the development team through the developers mailing list or by filing issues at http://github.com/cpp-netlib/cpp-netlib/issues.

Join us on Slack: http://slack.cpp-netlib.org/

You can reach the maintainers of the project through:

Dean Michael Berris ([email protected])

Glyn Matthews ([email protected])

cpp-netlib's People

Contributors

3noch avatar burannah avatar chenzhaoyu avatar cnagune avatar codemedic avatar danielbujnik avatar deanberris avatar dvd0101 avatar eakraly avatar el-bart avatar gjasny avatar glynos avatar igorpeshansky avatar infinity0 avatar jellevdd avatar kaspervandenberg avatar leecoder avatar lyytinen avatar mike-ect avatar mtrenkmann avatar nabagata avatar omalashenko avatar patlecat avatar povilasb avatar prantlf avatar susnux avatar tjadevries avatar umennel avatar vexocide avatar wujunzhuo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp-netlib's Issues

Invalid iterator in linearize

In version 0.9.0 we have

(message.hpp - line 98)
string_type body() const {
return _body;
}

this does not work with
(linearize.hpp - line 140)
typename body_range::type body_data = body(request).range();
return boost::copy(body_data, oi);

.. since body(request) creates a new string_type,
the body_data range is invalid at the copy statement.

The easiest fix is to make the const body observer return a const reference.

(message.hpp - line 98)
string_type const& body() const {
return _body;
}

... may be an idea to do the same for source, destinarion and headers too.

Array subscript warning in sync_base.hpp on gcc 4.4.3 with -O2

When compiling with gcc 4.4.3 and -O2 optimizations turned on, the boost::is_any_of("\r") checks in network/protocol/http/client/connection/sync_base.hpp cause an "array subscript is above array bounds" warning (which gets promoted to an error with -Werror). Changing this check to boost::is_from_range('\r', '\r') alleviates the issue.

Probably the same error noted here which is reported to be fixed in later versions:
https://bugzilla.redhat.com/show_bug.cgi?id=555771

Is the change to boost::is_from_range() a reasonable interim workaround for this presumed compiler deficiency?

Refactor URI

IMO, the URI code can be refactored so it is less coupled with HTTP. e.g. basic_uri in boost/network/uri.hpp contains a lot of functionality that only applies to an HTTP uri. I think it would be better to have a boost::network::basic_uri provide only a very coarse URI, which might cover:

://?

This is related to issue #15. In order to get this done, perhaps we need to order the URI into this kind of structure:

boost/network/uri/uri.hpp // rfc 3986
boost/network/uri/http/uri.hpp // rfc
boost/network/uri/mailto/uri.hpp // rfc 2368

etc.

Message concept check

We have a URI concept check, but not for Message.

Add a Message concept check and apply it to http::request and http::response.

Make the Default HTTP Client be an Asynchronous Client

Change the default from using the synchronous client to instead use the asynchronous client. This is so that the default choice will be the more feature-full choice. The other reason is so that the synchronous implementation is explicitly chosen and users who use it will know that they do want the blocking and potentially inefficient behavior implemented.

Using IPv6 with cpp-netlib is not supported

I had to disable the Teredo Tunneling interface in Windows 7 to get the asynchronous server to run.

Since the Teredo Tunneling interface comes pre-enabled on vista and windows 7 it would be pretty swell to implement IPv6 support.

Another workaround that was suggested was to bind to a IPv4 address to force IPv4 usage.

Develop an XMPP URI

This will be deceptively similar to #15 but with some important differences:

  1. XMPP URIs have a resource element, e.g. [email protected]/resource
  2. XMPP URIs can contain unicode values.

If we follow the scheme described in #18, the headers should be in:

boost/network/uri/xmpp/uri.hpp

Error compiling with Boost Version 1.45.0

Error compiling with Boost Version 1.45.0.
Here are errors:

/usr/local/include/boost/network/protocol/http/server/async_connection.hpp: In member function 'void boost::network::http::async_connection<Tag, Handler>::continue_write(Range, boost::function<void ()(boost::system::error_code)>)':
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp:495: error: expected primary-expression before '>' token
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp:496: error: expected primary-expression before ',' token
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp: In member function 'void boost::network::http::async_connection<Tag, Handler>::write_impl(Range, boost::function<void ()(boost::system::error_code)>)':
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp:592: error: expected primary-expression before '>' token
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp:593: error: expected primary-expression before ',' token
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp:600: error: expected primary-expression before '>' token
/usr/local/include/boost/network/protocol/http/server/async_connection.hpp:601: error: expected primary-expression before ',' token

Unable to compile example cpp-netlib-0.8/libs/network/example/http/hello_world_server.cpp

Support user-provided io_service

Given the suggestion by Cliff Green from the Boost developers mailing list, add support for a user-provided io_service to both the client and server constructors.

Implement a `header` wrapper

Implement the following namespace-level functions to act as accessor shortcuts to make deailing with messages easier:

template <class Tag>
typename basic_response<Tag>::string_type const
header(basic_response<Tag> & message, 
    typename basic_response<Tag>::string_type const & header_name,
    int offset = 0); // throws

template <class Tag>
boost::optional<typename basic_response<Tag>::string_type> const
header_nothrow(basic_response<Tag> & message,
    typename basic_response<Tag>::string_type const & header_name,
    int offset = 0); // no throw

This should be trivial to implement and should be easy to document as well.

Resolve the problem of using external components

This is especially important to resolve before submitting my XMPP client.

XMPP requires an XML parser, and various other components for security and authentication. It definitely falls outside the scope of our little project to rewrite the world and, in the case of some algorithms for cryptography, may violate the Boost license. So, it's necessary to define a policy for including such code in cpp-netlib or allowing the library to be extended to use such code.

First, it seems evident in our case that this can be partly done by deferring these to traits, so in the case of XML parsers we have:

namespace boost { namespace network { namespace traits {
template <
    class Tag
    >
struct xml_parser; // etc.
}}}

But where to put the parser code? So far, I've put things in the top level directory:

boost/network/xml/... (expat, libxml2)
boost/network/tls/... (gnutls)
boost/network/auth/...

but I don't think this is appropriate. Putting it in a subdirectory might be better:

boost/network/ext/xml/...

I would rule out "detail" because these aren't implementation details and may appear in the interface.

The questions to answer are therefore:

  1. What is the best strategy for reusing 3rd party components?
  2. Assuming that we write wrappers around every components, where do they belong in our directory structure?
  3. How well does our Tag approach scale?

I think the XMPP client might be the first real test of the true extensibility of the Tag approach this project is taking.

Include support for non-threaded asynchronous connection

From what I can tell from the documentation, cpp-netlib uses separate threads to facilitate asynchronous requests. It would be nice if an asynchronous implementation that didn't use threading was also available, so that I can issue many requests without having to create a thread for each - something like cURLs's multi interface or Qt's or libevent's event loop.

URI builder

For example:

namespace bn = boost::network;
bn::uri::uri instance;
instance << bn::uri::scheme("http")
         << bn::uri::authority("cpp-netlib.github.com")
    ;

or:

bn::uri::uri instance;
instance << bn::uri::schemes::http()
         << bn::uri::authority("cpp-netlib.github.com")
    ;

or:

bn::uri::uri instance;
instance << bn::uri::schemes::mailto() << "[email protected]";

or:

bn::uri::uri instance;
instance << bn::uri::schemes::xmpp()
         << bn::uri::xmpp::node("guest")
         << bn::uri::xmpp::domain("example.com")
         << bn::uri::xmpp::resource("support")
    ;

Building with mingw gcc on win32

Ive setup a build system using scons which utilizes mingw gcc on my winxp machine, i downloaded cpp-netlib 8.1, and am using boost_1_46_0.

All i need to do to reproduce the issue is have the line

"#include <boost/network/protocol/http/server.hpp>"

somewhere in my sourcecode, no actual usage of cppnet symbols is necessary.

I have here the full error output from a "-Wall -Wextra -pedantic --verbose" build, so it might be a little excessive, but im not sure whats going on here, so im hoping it helps more than hinders:

Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw g++ -o Debug\test\source\Communicator.o -c -Wall -Wextra -pedantic --verbose -O0 -g3 -DBOOST_SPIRIT_DEBUG -D_WIN32_WINNT=0x0501 -DBOOST_THREAD_USE_LIB -DRUNTESTS -IDependencies\Code\boost_1_46_0 -IDependencies\Code\cpp-netlib-0.8.1 -Iinclude source\Communicator.cpp Thread model: win32 gcc version 4.5.2 (GCC) COLLECT_GCC_OPTIONS='-o' 'Debug\test\source\Communicator.o' '-c' '-Wall' '-Wextra' '-pedantic' '-v' '-O0' '-g3' '-DBOOST_SPIRIT_DEBUG' '-D_WIN32_WINNT=0x0501' '-DBOOST_THREAD_USE_LIB' '-DRUNTESTS' '-IDependencies\Code\boost_1_46_0' '-IDependencies\Code\cpp-netlib-0.8.1' '-Iinclude' '-shared-libgcc' '-mtune=i386' '-march=i386' c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/cc1plus.exe -quiet -v -IDependencies\Code\boost_1_46_0 -IDependencies\Code\cpp-netlib-0.8.1 -Iinclude -iprefix c:\mingw\bin\../lib/gcc/mingw32/4.5.2/ -dD -DBOOST_SPIRIT_DEBUG -D_WIN32_WINNT=0x0501 -DBOOST_THREAD_USE_LIB -DRUNTESTS source\Communicator.cpp -quiet -dumpbase Communicator.cpp -mtune=i386 -march=i386 -auxbase-strip Debug\test\source\Communicator.o -g3 -O0 -Wall -Wextra -pedantic -version -o C:\DOCUME~1\col52n\LOCALS~1\Temp\ccVD0VqJ.s GNU C++ (GCC) version 4.5.2 (mingw32) compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR version 2.4.1, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../mingw32/include" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include/c++" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include/c++/mingw32" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include/c++/backward" ignoring duplicate directory "/mingw/lib/gcc/mingw32/4.5.2/../../../../include" ignoring duplicate directory "c:/mingw/lib/gcc/../../include" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include" ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/include-fixed" ignoring nonexistent directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.5.2/../../../../mingw32/include" ignoring duplicate directory "/mingw/include" #include "..." search starts here: #include <...> search starts here: Dependencies\Code\boost_1_46_0 Dependencies\Code\cpp-netlib-0.8.1 include c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include/c++ c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include/c++/mingw32 c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include/c++/backward c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include c:\mingw\bin\../lib/gcc/mingw32/4.5.2/include-fixed End of search list. GNU C++ (GCC) version 4.5.2 (mingw32) compiled by GNU C version 4.5.2, GMP version 5.0.1, MPFR version 2.4.1, MPC version 0.8.1 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: bba7c68567cab1560329ee702fa8a945 In file included from Dependencies\Code\boost_1_46_0/boost/date_time/microsec_time_clock.hpp:23:0, from Dependencies\Code\boost_1_46_0/boost/thread/thread_time.hpp:10, from Dependencies\Code\boost_1_46_0/boost/thread/win32/basic_timed_mutex.hpp:15, from Dependencies\Code\boost_1_46_0/boost/thread/win32/mutex.hpp:8, from Dependencies\Code\boost_1_46_0/boost/thread/mutex.hpp:14, from include/Communicator.hpp:19, from source\Communicator.cpp:1: Dependencies\Code\boost_1_46_0/boost/date_time/filetime_functions.hpp:99:32: warning: use of C++0x long long integer constant In file included from Dependencies\Code\boost_1_46_0/boost/date_time/posix_time/posix_time_system.hpp:14:0, from Dependencies\Code\boost_1_46_0/boost/date_time/posix_time/ptime.hpp:12, from Dependencies\Code\boost_1_46_0/boost/date_time/posix_time/posix_time_types.hpp:12, from Dependencies\Code\boost_1_46_0/boost/thread/thread_time.hpp:11, from Dependencies\Code\boost_1_46_0/boost/thread/win32/basic_timed_mutex.hpp:15, from Dependencies\Code\boost_1_46_0/boost/thread/win32/mutex.hpp:8, from Dependencies\Code\boost_1_46_0/boost/thread/mutex.hpp:14, from include/Communicator.hpp:19, from source\Communicator.cpp:1: Dependencies\Code\boost_1_46_0/boost/date_time/time_system_split.hpp:41:1: warning: use of C++0x long long integer constant In file included from Dependencies\Code\boost_1_46_0/boost/thread/shared_mutex.hpp:14:0, from Dependencies\Code\boost_1_46_0/boost/thread/detail/thread_group.hpp:9, from Dependencies\Code\boost_1_46_0/boost/thread/thread.hpp:24, from Dependencies\Code\boost_1_46_0/boost/thread/win32/condition_variable.hpp:13, from Dependencies\Code\boost_1_46_0/boost/thread/condition_variable.hpp:14, from Dependencies\Code\boost_1_46_0/boost/thread/future.hpp:13, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/traits/version.hpp:13, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:12, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\boost_1_46_0/boost/thread/win32/shared_mutex.hpp: In constructor 'boost::shared_mutex::shared_mutex()': Dependencies\Code\boost_1_46_0/boost/thread/win32/shared_mutex.hpp:84:33: warning: missing initializer for member 'boost::shared_mutex::state_data::shared_waiting' Dependencies\Code\boost_1_46_0/boost/thread/win32/shared_mutex.hpp:84:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive' Dependencies\Code\boost_1_46_0/boost/thread/win32/shared_mutex.hpp:84:33: warning: missing initializer for member 'boost::shared_mutex::state_data::upgrade' Dependencies\Code\boost_1_46_0/boost/thread/win32/shared_mutex.hpp:84:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive_waiting' Dependencies\Code\boost_1_46_0/boost/thread/win32/shared_mutex.hpp:84:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive_waiting_blocked' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:14:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/directives/status_message.hpp: At global scope: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/directives/status_message.hpp:17:48: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:15:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/directives/version.hpp:15:107: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:17:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/directives/uri.hpp:15:83: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/modifiers/source.hpp:12:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:23, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:31:60: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:32:60: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:33:62: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:34:62: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:35:58: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:36:58: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:37:42: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/tags.hpp:38:48: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/modifiers/source.hpp:13:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:23, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/message/directives.hpp:26:101: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/modifiers/source.hpp:13:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:23, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/message/directives.hpp:27:131: warning: extra ';' Dependencies\Code\cpp-netlib-0.8.1/boost/network/message/directives.hpp:28:89: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:31:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/wrappers/destination.hpp:25:77: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:32:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/wrappers/source.hpp:19:62: warning: extra ';' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/message_traits.hpp:52:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits.hpp:14, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:15, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/delimiters.ipp:17:51: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/delimiters.ipp:22:59: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/delimiters.ipp:27:67: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/message_traits.hpp:53:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits.hpp:14, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:15, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:16:44: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:21:46: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:26:50: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:31:50: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:36:52: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:41:54: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:46:56: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:51:53: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:56:57: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:61:57: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:66:48: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/headers.ipp:71:53: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/message_traits.hpp:54:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits.hpp:14, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:15, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/content.ipp:16:49: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/content.ipp:21:49: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/content.ipp:26:48: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/content.ipp:31:55: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/message_traits.hpp:55:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits.hpp:14, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:15, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/request_methods.ipp:16:44: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/request_methods.ipp:21:43: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/request_methods.ipp:26:43: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/request_methods.ipp:31:44: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/request_methods.ipp:36:47: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/message_traits.hpp:56:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits.hpp:14, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:15, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:16:42: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:21:47: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:26:50: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:31:52: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:36:49: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:41:49: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:46:58: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:51:52: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:56:51: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:61:52: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/traits/impl/response_message.ipp:66:55: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:63:91: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:71:91: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:103:40: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message.hpp:145:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:35, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/impl/message.ipp:132:150: warning: type qualifiers ignored on function return type Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/impl/message.ipp:213:152: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/response.hpp:36:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:12, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/message/async_message.hpp:69:40: warning: type qualifiers ignored on function return type In file included from Dependencies\Code\boost_1_46_0/boost/range/metafunctions.hpp:19:0, from Dependencies\Code\boost_1_46_0/boost/range.hpp:27, from Dependencies\Code\boost_1_46_0/boost/spirit/home/qi/string/symbols.hpp:28, from Dependencies\Code\boost_1_46_0/boost/spirit/home/qi/string.hpp:15, from Dependencies\Code\boost_1_46_0/boost/spirit/include/qi_core.hpp:25, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp:11, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:12, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri.hpp:11, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/impl/request.hpp:17, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/request.hpp:43, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:13, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\boost_1_46_0/boost/range/has_range_iterator.hpp:22:42: warning: extra ';' In file included from Dependencies\Code\boost_1_46_0/boost/asio/ip/address_v6.hpp:227:0, from Dependencies\Code\boost_1_46_0/boost/asio/ip/address.hpp:22, from Dependencies\Code\boost_1_46_0/boost/asio/ip/basic_endpoint.hpp:19, from Dependencies\Code\boost_1_46_0/boost/asio/ip/tcp.hpp:24, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server/sync_server.hpp:13, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:14, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\boost_1_46_0/boost/asio/ip/impl/address_v6.ipp: In constructor 'boost::asio::ip::address_v6::address_v6()': Dependencies\Code\boost_1_46_0/boost/asio/ip/impl/address_v6.ipp:37:49: warning: missing braces around initializer for 'in6_addr::' Dependencies\Code\boost_1_46_0/boost/asio/ip/impl/address_v6.ipp:37:49: warning: missing braces around initializer for 'u_char [16]' Dependencies\Code\boost_1_46_0/boost/asio/ip/impl/address_v6.ipp: In static member function 'static boost::asio::ip::address_v6 boost::asio::ip::address_v6::loopback()': Dependencies\Code\boost_1_46_0/boost/asio/ip/impl/address_v6.ipp:259:49: warning: missing braces around initializer for 'in6_addr::' Dependencies\Code\boost_1_46_0/boost/asio/ip/impl/address_v6.ipp:259:49: warning: missing braces around initializer for 'u_char [16]' In file included from Dependencies\Code\boost_1_46_0/boost/asio/ip/detail/endpoint.hpp:139:0, from Dependencies\Code\boost_1_46_0/boost/asio/ip/basic_endpoint.hpp:20, from Dependencies\Code\boost_1_46_0/boost/asio/ip/tcp.hpp:24, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server/sync_server.hpp:13, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:14, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\boost_1_46_0/boost/asio/ip/detail/impl/endpoint.ipp: In constructor 'boost::asio::ip::detail::endpoint::endpoint(int, short unsigned int)': Dependencies\Code\boost_1_46_0/boost/asio/ip/detail/impl/endpoint.ipp:60:51: warning: missing braces around initializer for 'in6_addr::' Dependencies\Code\boost_1_46_0/boost/asio/ip/detail/impl/endpoint.ipp:60:51: warning: missing braces around initializer for 'u_char [16]' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server/async_connection.hpp:12:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server/async_server.hpp:9, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:15, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/utils/thread_pool.hpp: At global scope: Dependencies\Code\cpp-netlib-0.8.1/boost/network/utils/thread_pool.hpp:71:42: warning: type qualifiers ignored on function return type In file included from include/Communicator.hpp:26:0, from source\Communicator.cpp:1: include/Listener.hpp:31:7: warning: unused parameter 'request' include/Listener.hpp:31:7: warning: unused parameter 'connection' In file included from Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:12:0, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri.hpp:11, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/impl/request.hpp:17, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/request.hpp:43, from Dependencies\Code\cpp-netlib-0.8.1/boost/network/protocol/http/server.hpp:13, from include/Listener.hpp:5, from include/Communicator.hpp:26, from source\Communicator.cpp:1: Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp: In instantiation of 'bool boost::network::uri::detail::parse_specific(boost::network::uri::detail::uri_parts&) [with Tag = boost::network::tags::default_string]': Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp:255:9: instantiated from 'bool boost::network::uri::detail::parse_uri(Range&, boost::network::uri::detail::uri_parts&) [with Range = std::basic_string, Tag = boost::network::tags::default_string]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:25:39: instantiated from 'boost::network::uri::uri_base::uri_base(boost::network::uri::uri_base::string_type&) [with Tag = boost::network::tags::default_string, boost::network::uri::uri_base::string_type = std::basic_string]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:116:33: instantiated from 'boost::network::uri::basic_uri::basic_uri() [with Tag = boost::network::tags::default_string]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/uri_concept.hpp:21:19: instantiated from 'boost::network::uri::URI::~URI() [with U = boost::network::uri::basic_uri]' Dependencies\Code\boost_1_46_0/boost/concept/detail/general.hpp:38:28: instantiated from 'static void boost::concepts::requirement::failed() [with Model = boost::network::uri::URI >]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:198:1: instantiated from here Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp:233:6: warning: unused parameter 'parts' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp: In instantiation of 'bool boost::network::uri::detail::parse_specific(boost::network::uri::detail::uri_parts&) [with Tag = boost::network::tags::default_wstring]': Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp:255:9: instantiated from 'bool boost::network::uri::detail::parse_uri(Range&, boost::network::uri::detail::uri_parts&) [with Range = std::basic_string, Tag = boost::network::tags::default_wstring]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:25:39: instantiated from 'boost::network::uri::uri_base::uri_base(boost::network::uri::uri_base::string_type&) [with Tag = boost::network::tags::default_wstring, boost::network::uri::uri_base::string_type = std::basic_string]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:116:33: instantiated from 'boost::network::uri::basic_uri::basic_uri() [with Tag = boost::network::tags::default_wstring]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/uri_concept.hpp:21:19: instantiated from 'boost::network::uri::URI::~URI() [with U = boost::network::uri::basic_uri]' Dependencies\Code\boost_1_46_0/boost/concept/detail/general.hpp:38:28: instantiated from 'static void boost::concepts::requirement::failed() [with Model = boost::network::uri::URI >]' Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/basic_uri.hpp:199:1: instantiated from here Dependencies\Code\cpp-netlib-0.8.1/boost/network/uri/detail/parse_uri.hpp:233:6: warning: unused parameter 'parts' scons: *** [Debug\test\source\Communicator.o] Error 1 scons: building terminated because of errors. make: *** [all] Error 2

Improve the Web Face

Let's try to change the landing page for cpp-netlib.github.com to just link to the documentation and to have action buttons directly to the different packages.

Content-Type header value not possible to change

I tried with clear_headers, then adding the header with different value, like "application/json". It adds the header with the same key "Content-Type" twice and never removes the original "x-application/octet-stream".

Client compilation failure when including boost/network/protocol/http/server.hpp

The following code fails to compile on MSVC 8.0:

#include "boost/network/protocol/http/client.hpp"
#include "boost/network/protocol/http/server.hpp"
int
main(int argc, char *argv[]) {
    typedef
        boost::network::http::basic_client<boost::network::tags::http_keepalive_8bit_udp_resolve, 1, 1> http_client;
    http_client client;
    return 0;
}

This fails with the following compilation error:

..\..\..\boost/network/protocol/http/policies/sync_resolver.hpp(25) : error C2059: syntax error : '<'
        ..\..\..\boost/network/protocol/http/policies/pooled_connection.hpp(25) : see reference to class template instantiation 'boost::network::http::policies::sync_resolver<Tag>' being compiled
        with
        [
            Tag=boost::network::tags::http_keepalive_8bit_udp_resolve
        ]
        ..\..\..\boost/network/protocol/http/client.hpp(29) : see reference to class template instantiation 'boost::network::http::pooled_connection_policy<Tag,version_major,version_minor>' being compiled
        with
        [
            Tag=boost::network::tags::http_keepalive_8bit_udp_resolve,
            version_major=1,
            version_minor=1
        ]
        erik_test.cpp(16) : see reference to class template instantiation 'boost::network::http::basic_client<Tag,version_major,version_minor>' being compiled
        with
        [
            Tag=boost::network::tags::http_keepalive_8bit_udp_resolve,
            version_major=1,
            version_minor=1
        ]
..\..\..\boost/network/protocol/http/policies/sync_resolver.hpp(25) : error C2039: 'type' : is not a member of '`global namespace''
..\..\..\boost/network/protocol/http/policies/sync_resolver.hpp(25) : error C2238: unexpected token(s) preceding ';'
..\..\..\boost/network/protocol/http/policies/sync_resolver.hpp(26) : error C2065: 'string_type' : undeclared identifier
..\..\..\boost/network/protocol/http/policies/sync_resolver.hpp(32) : error C2061: syntax error : identifier 'string_type'

Automated test process

We have some volunteer testers who are willing to donate some time and resources to testing on platforms that the core developers don't have access to.

We need to develop a procedure that allows us to take advantage of this in a non-intrusive way by automating as much of the testing as possible.

boost comes with a set of scripts for regression testing which is very useful. I'd like to re-use as much of this as possible, particularly the reporting part.

To do:

  1. Write a script that downloads the latest version from mikhailberis/cpp-netlib, specifying the branch / revision - we don't need to go through the repository directly because github can generate a .tar.gz or .zip of this. This can be useful because git support on windows isn't so hot.
  2. Then it's easy to have a script unpack and build it, as long as the host has a correct installation of boost
  3. The results need to be reported ... but where? Is it possible to post them somewhere on github? Would that require testers to have github accounts?

I cannot build the cpp-netlib library with CMake.

I cannot build the cpp-netlib library completely because show status "Could NOT find Boost".
How to specific a path for including Boost?

-DCMAKE_C_COMPILER=gcc
-DCMAKE_CXX_COMPILER=g++
.
-- Could NOT find Boost
-- Found OpenSSL: /usr/lib/libssl.so;/usr/lib/libcrypto.so
-- Could NOT find Boost
-- Could NOT find Boost
-- Found OpenSSL: /usr/lib/libssl.so;/usr/lib/libcrypto.so
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= gcc
CMAKE_CXX_COMPILER= g++

http_client failing on MSVC 10

Another issue reported on the Boost user's list:

Hi there, I'm trying to run http_client.cpp taken from the netlib
examples. But unfortunately it's throwing a lot of exceptions.

The line:

cout << body(response) << endl;

results into the following exceptions:

First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x00bddcd0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x00bddcd0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x00bddcd0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x00bddcd0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x00bddcd0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x002cece0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x00bddcd0..
First-chance exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception: [rethrow] at memory location 0x00000000..
Unhandled exception at 0x000007fefdd0aa7d in test_netlib_vc10.exe:
Microsoft C++ exception:
boost::exception_detail::clone_implboost::system::system_error at
memory location 0x002cece0..

here is my stack:

msvcr100d.dll!_CxxThrowException(void *
pExceptionObject=0x000000000030ee20, const _s__ThrowInfo *
pThrowInfo=0x000000013f526cd8) Line 157 C++
test_netlib_vc10.exe!boost::exception_detail::clone_implboost::system::system_error::rethrow()
Line 421 C++
test_netlib_vc10.exe!boost::rethrow_exception(const
boost::shared_ptr<boost::exception_detail::clone_base const > &
p={...}) Line 413 C++
test_netlib_vc10.exe!boost::detail::future_object_base::wait(bool
rethrow=true) Line 170 + 0x11 bytes C++
test_netlib_vc10.exe!boost::detail::future_objectstd::basic_string<char,std::char_traits<char,std::allocator

::get() Line 331 C++
test_netlib_vc10.exe!boost::shared_futurestd::basic_string<char,std::char_traits<char,std::allocator
::get() Line 847 + 0x12 bytes C++
test_netlib_vc10.exe!boost::network::http::async_messageboost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2boost::network::tags::http,boost::network::tags::simple,boost::network::tags::async,boost::network::tags::tcp>,boost::network::tags::default_string>
::body() Line 107 + 0x18 bytes C++
test_netlib_vc10.exe!boost::network::http::impl::body_wrapperboost::network::http::basic_response<boost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2boost::network::tags::http,boost::network::tags::simple,boost::network::tags::async,boost::network::tags::tcp>,boost::network::tags::default_string>
::operator std::basic_string<char,std::char_traits,std::allocator
() Line 30 + 0x12 bytes C++
test_netlib_vc10.exe!boost::network::http::bodyboost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2boost::network::tags::http,boost::network::tags::simple,boost::network::tags::async,boost::network::tags::tcp>,boost::network::tags::default_string>
(const boost::network::http::basic_responseboost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2<boost::mpl::inherit2boost::network::tags::http,boost::network::tags::simple,boost::network::tags::async,boost::network::tags::tcp>,boost::network::tags::default_string>
& message={...}) Line 41 + 0x1f bytes C++
test_netlib_vc10.exe!main(int argc=2, char * *
argv=0x00000000004f7850) Line 86 + 0x15 bytes C++
test_netlib_vc10.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
test_netlib_vc10.exe!mainCRTStartup() Line 371 C

I'm using boost trunk with Visual Studio 10 compiling x64 bit code.

Anyone any idea what going on here?

Thanks,

Christian

OpenSSL and cpp-netlib

a program like

#include "boost/network/protocol/http.hpp"
typedef network::http::basic_client<tags::http_keepalive_8bit_udp_resolve, 1, 1> http_client;
http_client();

makes an error

C:\work\boost\boost/asio/ssl/detail/openssl_types.hpp(23) : fatal error C1083: Cannot open include file: 'openssl/conf.h': No such file or directory

if openssl is installed. this example shouldn't need OpenSSL.

RSS or Atom feed example

Develop a small example of a web feed.

One problem point is that this requires an XML parser, which is out of the cpp-netlib scope. Perhaps it would be easy to use [RapidXML](http://rapidxml.sourceforge.net/ RapidXML) in an example, which we could easily distribute.

Errors compiling with g++ (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13) - 0.9.0 and git

Hi

Thank you for developing this library. I'm having trouble compiling the following
code with g++ (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13) - RHEL 6 with boost 1.41
However, the same code works on my OS X Machine using
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) with
boost 1.46.1

I tried both 0.9.0 and git versions.


#include <string>
#include <iostream>
#define BOOST_NETWORK_NO_LIB 1
#include "boost/network/uri.hpp"

int main()
{

std::string remote_info("sip:192.168.1.50");
boost::network::uri::uri instance(remote_info);
assert(boost::network::uri::valid(instance));

std::cout << "scheme: " << boost::network::uri::scheme(instance) << std::endl
          << "host: " << boost::network::uri::host(instance) << std::endl
          << "path: " << boost::network::uri::path(instance) << std::endl
          << "port: " << boost::network::uri::port(instance) << std::endl;

return true;
}

./cpp-netlib/boost/network/uri/detail/impl/parse_uri.ipp: In static member function static boost::fusion::extension::struct_member<boost::network::uri::detail::uri_parts_default_base, 4>::type& boost::fusion::extension::struct_member<boost::network::uri::detail::uri_parts_default_base, 4>::call(boost::network::uri::detail::uri_parts_default_base&):
./cpp-netlib/boost/network/uri/detail/impl/parse_uri.ipp:41: error: invalid initialization of reference of type boost::fusion::extension::struct_member<boost::network::uri::detail::uri_parts_default_base, 4>::type& from expression of type boost::network::uri::detail::uri_parts_default_base::string_type
./cpp-netlib/boost/network/uri/detail/impl/parse_uri.ipp: In static member function static boost::fusion::extension::struct_member<boost::network::uri::detail::uri_parts_wide_base, 4>::type& boost::fusion::extension::struct_member<boost::network::uri::detail::uri_parts_wide_base, 4>::call(boost::network::uri::detail::uri_parts_wide_base&):
./cpp-netlib/boost/network/uri/detail/impl/parse_uri.ipp:51: error: invalid initialization of reference of type boost::fusion::extension::struct_member<boost::network::uri::detail::uri_parts_wide_base, 4>::type& from expression of type boost::network::uri::detail::uri_parts_wide_base::string_type

I appreciate any help.

Develop tests for the URI parser and e-mail addresses

The main difficulty here would be that the existing framework supports HTTP URIs, and it's implementation isn't very clean. We'd need to refactor this parser into the boost::network::uri::http namespace first.

Dean is in favour of a 2-stage parsing approach, first a general parser then a specialized parser.

boost::network::uri::parse_uri
|
|
v
boost::network::uri::http::parse_uri boost::network::uri::mailto::parse_uri

0.9devel async_server run stop listen synchronization issue

if you bind async_server::run to a thread and then immediately call stop on that server instance, you can end up with a sync issue where calling cancel or similar on the acceptor will throw because it may not be open and listening yet.

a possible fix would be to check if async_server is in listening mode yet or not, and then only attempt to cancel the acceptor if so.

further, checking if async_server is stopping before attempting to start_listening would be useful too.

string.hpp includes needed

boost/network/protocol/http/policies/sync_resolver.hpp
and
boost/network/protocol/http/detail/connection_helper.hpp

both refer to the string class and need

#include <boost/network/traits/string.hpp>

added to them

Compilation error after moving to boost 1.46.1

parse_uri_impl.cpp no longer compiles under Visual Studio 2008 SP1 after moving from boost 1.54 to 1.46.1 with error:

Error 34 error C2664: 'boost::spirit::qi::transform_attribute<Exposed,Transformed>::pre' : cannot convert parameter 1 from 'boost::optional' to 'boost::spirit::qi::optional &' c:\devel\boost_1_46_1\boost\spirit\home\qi\nonterminal\rule.hpp 266

server_async.cpp exception with VS2008

Hello, thanks for the great library!!!
I try to build test project (server_async.cpp) with boost 1.44 and cpp-netlib-0.9.0 with VIsual Studio 2008.
I'am add only #define BOOST_NETWORK_NO_LIB
Source code was compile and linked successful.

#define BOOST_NETWORK_NO_LIB

#include <boost/config/warning_disable.hpp>
#include <boost/network/include/http/server.hpp>
#include <boost/network/utils/thread_pool.hpp>
#include <boost/range/algorithm/find_if.hpp>

namespace net = boost::network;
namespace http = boost::network::http;
namespace utils = boost::network::utils;

struct async_hello_world;
typedef http::async_server<async_hello_world> server;

struct async_hello_world {

    struct is_content_length {
        template <class Header>
        bool operator()(Header const & header) {
            return boost::iequals(name(header), "content-length");
        }
    };

    void operator()(server::request const & request, server::connection_ptr connection) {
        static server::response_header headers[] = {
            {"Connection", "close"}
            , {"Content-Type", "text/plain"}
            , {"Server", "cpp-netlib/0.9"}
            , {"Content-Length", "13"}
        };
        static std::string hello_world("Hello, World!");
        connection->set_status(server::connection::ok);
        connection->set_headers(boost::make_iterator_range(headers, headers+4));
        connection->write(hello_world);
    }
};

int main(int argc, char * argv[]) {
    utils::thread_pool thread_pool(2); 
    async_hello_world handler;
    std::string port = "8000";
    if (argc > 1) port = argv[1];
    server instance("localhost", port, handler, thread_pool, http::_reuse_address=true);
    instance.run();
    return 0;
}

Program started, but if i go to http://localhost:8000/ i get exception

Unhandled exception at 0x76d3b727 in server_d.exe: Microsoft C++ exception:
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::bad_cast> >
at memory location 0x0038eb78..

Help me please!
Sorry for bad english

Use Boost.Parameter on HTTP Client API

Make the HTTP Client facade use Boost.Parameter to allow for easily adding new supported parameters as time goes on. This should make it easier to make backwards-source-compatible changes to the API and introduce new features and flags.

Fix for URI spirit parser on MSVC 10 Express

From a message on the Boost user's list:

Hi there, when compiling basic tests of netlib 0.7 one has to include
boost/thread.hpp. A small change is also needed in line of
parse_uri.hpp[28] from

#if SPIRIT_VERSION > 0x2030

to

#if SPIRIT_VERSION >= 0x2030

I'm using Visual Studio 10 Express. Also the time it takes to compile
a simple test is very high. I hope this will change with the upcoming

0.8 version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.