Skip to content

Commit fd25971

Browse files
committed
Merge branch '0.9-devel'
2 parents 63bcf03 + a32c9bd commit fd25971

File tree

364 files changed

+25191
-22255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+25191
-22255
lines changed

CMakeLists.txt

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,38 @@
33
# (See accompanying file LICENSE_1_0.txt or copy at
44
# http://www.boost.org/LICENSE_1_0.txt)
55

6-
cmake_minimum_required(VERSION 2.6)
6+
cmake_minimum_required(VERSION 2.8)
77
project(CPP-NETLIB)
8-
find_package( Boost 1.41.0 )
8+
set(Boost_USE_STATIC_LIBS ON)
9+
set(Boost_USE_MULTI_THREADED ON)
10+
find_package( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread filesystem program_options )
11+
find_package( OpenSSL )
12+
find_package( Threads )
913
set(CMAKE_VERBOSE_MAKEFILE true)
1014

1115
if (CMAKE_BUILD_TYPE MATCHES Debug)
1216
add_definitions(-DBOOST_NETWORK_DEBUG)
1317
endif()
14-
18+
19+
if (OPENSSL_FOUND)
20+
add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)
21+
endif()
22+
1523
if (Boost_FOUND)
16-
set(Boost_USE_STATIC_LIBS ON)
17-
set(Boost_USE_MULTI_THREADED ON)
24+
if (MSVC)
25+
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
26+
endif(MSVC)
27+
if (WIN32)
28+
add_definitions(-D_WIN32_WINNT=0x0501)
29+
endif(WIN32)
1830
include_directories(${Boost_INCLUDE_DIRS})
19-
endif()
20-
enable_testing()
21-
add_subdirectory(libs/network/src)
22-
add_subdirectory(libs/network/test)
23-
add_subdirectory(libs/mime/test)
24-
add_subdirectory(libs/network/example)
31+
enable_testing()
32+
add_subdirectory(libs/network/src)
33+
add_subdirectory(libs/network/test)
34+
if (NOT MSVC)
35+
add_subdirectory(libs/mime/test)
36+
endif(NOT MSVC)
37+
add_subdirectory(libs/network/example)
38+
endif(Boost_FOUND)
2539

40+
enable_testing()

README.rst

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ cpp-netlib offers the following implementations:
1515
generate message objects from strings.
1616
* Adapters and Wrappers -- A collection of Adapters and wrappers aimed
1717
towards making the message type STL friendly.
18-
* Network protocol client and server implementations -- A collection
19-
of network protocol implementations that include embeddable client
18+
* Network protocol client and server implementations -- A collection
19+
of network protocol implementations that include embeddable client
2020
and server types.
2121

2222
This library is released under the Boost Software License (please see
@@ -33,44 +33,12 @@ You can find official release packages of the library at::
3333
Building and Installing
3434
-----------------------
3535

36-
Since cpp-netlib is a header-only library, there is nothing to build. To install
37-
cpp-netlib, you can choose to copy the contents of the ``boost`` directory into
38-
an existing Boost [#]_ distribution or to a different location. All that is
39-
required is for projects that use cpp-netlib when building, have the directory
40-
where cpp-netlib is installed as part of the include paths.
41-
42-
.. [#] http://www.boost.org/
43-
44-
The recommended installation procedure would be to follow the steps below::
45-
46-
# On Linux/Mac, consider the `$` character as the shell prompt
47-
$ sudo mkdir -p /usr/local/include/cpp-netlib
48-
$ sudo cp -r cpp-netlib/boost /usr/local/include/cpp-netlib
49-
50-
Now don't forget to add ``/usr/local/include/cpp-netlib`` in your project's
51-
compiler include directories to start using cpp-netlib in your projects.
52-
53-
Running Tests
54-
-------------
55-
56-
If you want to run the tests that come with cpp-netlib, there are a few things
57-
you will need. These are:
58-
59-
* A compiler (GCC 4.x or Clang 2.8)
60-
* A build tool (CMake [#]_ recommended, Boost.Build also an option)
61-
* OpenSSL headers (optional with CMake, mandatory for Boost.Build)
62-
* Python 2.6
63-
64-
.. note:: This assumes that you have the cpp-netlib distribution package
65-
unpacked somwhere in your home directory. This specifically assumes that you
66-
have cpp-netlib at the toplevel of your home directory.
67-
.. [#] http://www.cmake.org/
68-
6936
Building with CMake
7037
~~~~~~~~~~~~~~~~~~~
7138

72-
To build and run the tests with CMake, you will need to have CMake version 2.8
73-
or higher installed appropriately in your system.
39+
To build the libraries and run the tests with CMake, you will need to
40+
have CMake version 2.8 or higher installed appropriately in your
41+
system.
7442

7543
::
7644

@@ -81,16 +49,11 @@ Inside the cpp-netlib directory, you can issue the following statements to
8149
configure and generate the Makefiles, and build the tests::
8250

8351
$ cd ~/cpp-netlib # we're assuming it's where cpp-netlib is
84-
$ cmake -DCMAKE_BUILD_TYPE=Debug \
85-
> -CMAKE_C_COMPILER=clang \
86-
> -CMAKE_CXX_COMPILER=clang++ \
52+
$ cmake -DCMAKE_BUILD_TYPE=Debug \
53+
> -DCMAKE_C_COMPILER=clang \
54+
> -DCMAKE_CXX_COMPILER=clang++ \
8755
> .
8856

89-
.. note:: This uses the source directory as the build directory as well. At the
90-
time of this writing, cpp-netlib is meant to be tested in the same directory
91-
where the source files are, because of the way the tests depend on Python
92-
being installed and having access to Python scripts during the build.
93-
9457
Once CMake is done with generating the Makefiles and configuring the project,
9558
you can now build the tests and run them::
9659

@@ -102,7 +65,7 @@ If for some reason some of the tests fail, you can send the files in
10265
``Testing/Temporary/`` as attachments to the cpp-netlib `developers mailing
10366
list`_.
10467

105-
.. _`developers mailing list`: https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel
68+
.. _`developers mailing list`: cpp-netlib@googlegroups.com
10669

10770
Building with Boost.Build
10871
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -113,7 +76,7 @@ to copy the ``bjam`` executable to a directory that is already in your ``PATH``
11376
so that you don't have to go hunting for it all the time. A good place to put it
11477
is in ``/usr/local/bin``.
11578

116-
.. [#] http://www.boost.org/doc/libs/1_44_0/more/getting_started/index.html
79+
.. [#] http://www.boost.org/doc/libs/release/more/getting_started/
11780
11881
Building and running the tests can be as simple as doing the following::
11982

@@ -130,7 +93,21 @@ please do the following::
13093
And then attach the ``build-test.log`` file to the email you will send to the
13194
cpp-netlib `developers mailing list`_.
13295

133-
.. _`developers mailing list`: https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel
96+
.. _`developers mailing list`: cpp-netlib@googlegroups.com
97+
98+
Running Tests
99+
-------------
100+
101+
If you want to run the tests that come with cpp-netlib, there are a few things
102+
you will need. These are:
103+
104+
* A compiler (GCC 4.x, Clang 2.8, MSVC 2008)
105+
* A build tool (CMake [#]_ recommended, Boost.Build also an option)
106+
* OpenSSL headers (optional)
107+
108+
.. note:: This assumes that you have cpp-netlib at the top-level of
109+
your home directory.
110+
[#] http://www.cmake.org/
134111

135112
Hacking on cpp-netlib
136113
---------------------
@@ -174,14 +151,10 @@ In case you have any questions or would like to make feature requests, you can
174151
contact the development team through the `developers mailing list`_
175152
or by filing issues at http://github.com/cpp-netlib/cpp-netlib/issues.
176153

177-
.. _`developers mailing list`:
178-
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel
154+
.. _`developers mailing list`: cpp-netlib@googlegroups.com
179155

180156
You can reach the maintainers of the project through::
181157

182158
Dean Michael Berris (dberris@google.com)
183159

184-
Glyn Matthews
185-
186-
Mike Dickey
187-
160+
Glyn Matthews (glyn.matthews@gmail.com)

boost/mime.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ class basic_mime {
658658
void check_subpart_index ( size_t idx ) const {
659659
if ( get_part_kind () == simple_part )
660660
throw std::runtime_error ( "Simple Mime parts don't have sub-parts" );
661-
else if ( get_part_kind == multi_part ) {
661+
else if ( get_part_kind () == multi_part ) {
662662
if ( idx >= m_subparts.size ())
663663
throw std::runtime_error (
664664
str ( boost::format ( "Trying to access part %d (of %d) sub-part to a multipart/xxx mime part" ) % idx % m_subparts.size ()));

0 commit comments

Comments
 (0)