Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Modern C++ network programming libraries.
.. image:: https://scan.coverity.com/projects/6714/badge.svg
:target: https://scan.coverity.com/projects/cpp-netlib

.. image:: https://img.shields.io/badge/license-boost-blue.svg
:target: https://github.com/cpp-netlib/cpp-netlib/blob/master/LICENSE_1_0.txt

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

Subscribe to the mailing list: https://groups.google.com/forum/#!forum/cpp-netlib
Expand Down
17 changes: 0 additions & 17 deletions boost/network.hpp

This file was deleted.

36 changes: 15 additions & 21 deletions boost/network/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,80 +18,75 @@ template <class Tag>
struct constants_narrow {

static char const* crlf() {
static char crlf_[] = {'\r', '\n', 0};
static char crlf_[] = "\r\n";
return crlf_;
}

static char const* dot() {
static char dot_[] = {'.', 0};
static char dot_[] = ".";
return dot_;
}

static char dot_char() { return '.'; }

static char const* http_slash() {
static char http_slash_[] = {'H', 'T', 'T', 'P', '/', 0};
static char http_slash_[] = "HTTP/";
return http_slash_;
}

static char const* space() {
static char space_[] = {' ', 0};
static char space_[] = " ";
return space_;
}

static char space_char() { return ' '; }

static char const* slash() {
static char slash_[] = {'/', 0};
static char slash_[] = "/";
return slash_;
}

static char slash_char() { return '/'; }

static char const* host() {
static char host_[] = {'H', 'o', 's', 't', 0};
static char host_[] = "Host";
return host_;
}

static char const* colon() {
static char colon_[] = {':', 0};
static char colon_[] = ":";
return colon_;
}

static char colon_char() { return ':'; }

static char const* accept() {
static char accept_[] = {'A', 'c', 'c', 'e', 'p', 't', 0};
static char accept_[] = "Accept";
return accept_;
}

static char const* default_accept_mime() {
static char mime_[] = {'*', '/', '*', 0};
static char mime_[] = "*/*";
return mime_;
}

static char const* accept_encoding() {
static char accept_encoding_[] = {'A', 'c', 'c', 'e', 'p', 't', '-', 'E',
'n', 'c', 'o', 'd', 'i', 'n', 'g', 0};
static char accept_encoding_[] = "Accept-Encoding";
return accept_encoding_;
}

static char const* default_accept_encoding() {
static char default_accept_encoding_[] = {
'i', 'd', 'e', 'n', 't', 'i', 't', 'y', ';', 'q', '=',
'1', '.', '0', ',', ' ', '*', ';', 'q', '=', '0', 0};
static char default_accept_encoding_[] = "identity;q=1.0, *;q=0";
return default_accept_encoding_;
}

static char const* user_agent() {
static char user_agent_[] = {'U', 's', 'e', 'r', '-', 'A',
'g', 'e', 'n', 't', 0};
static char user_agent_[] = "User-Agent";
return user_agent_;
}

static char const* cpp_netlib_slash() {
static char cpp_netlib_slash_[] = {'c', 'p', 'p', '-', 'n', 'e',
't', 'l', 'i', 'b', '/', 0};
static char cpp_netlib_slash_[] = "cpp-netlib/";
return cpp_netlib_slash_;
}

Expand All @@ -100,13 +95,12 @@ struct constants_narrow {
static char hash_char() { return '#'; }

static char const* connection() {
static char connection_[] = {'C', 'o', 'n', 'n', 'e', 'c',
't', 'i', 'o', 'n', 0};
static char connection_[] = "Connection";
return connection_;
}

static char const* close() {
static char close_[] = {'C', 'l', 'o', 's', 'e', 0};
static char close_[] = "Close";
return close_;
}

Expand Down
13 changes: 0 additions & 13 deletions boost/network/include/http/client.hpp

This file was deleted.

13 changes: 0 additions & 13 deletions boost/network/include/http/server.hpp

This file was deleted.

17 changes: 0 additions & 17 deletions boost/network/include/message.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion boost/network/protocol/http/client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <boost/config.hpp>
#include <boost/network/protocol/http/message.hpp>
#include <boost/network/protocol/http/request.hpp>
#include <boost/network/protocol/http/response.hpp>
#include <boost/network/protocol/http/client/response.hpp>
#include <boost/network/traits/ostringstream.hpp>

#include <boost/algorithm/string/classification.hpp>
Expand Down
10 changes: 2 additions & 8 deletions boost/network/protocol/http/client/facade.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@
#include <memory>
#include <functional>
#include <boost/network/protocol/http/client/pimpl.hpp>
#include <boost/network/protocol/http/request.hpp>
#include <boost/network/protocol/http/response.hpp>
#include <boost/network/protocol/http/client/request.hpp>
#include <boost/network/protocol/http/client/response.hpp>

namespace boost {
namespace network {
namespace http {

template <class Tag>
struct basic_request;

template <class Tag>
struct basic_response;

template <class Tag, unsigned version_major, unsigned version_minor>
class basic_client_facade {
typedef basic_client_impl<Tag, version_major, version_minor> pimpl_type;
Expand Down
19 changes: 19 additions & 0 deletions boost/network/protocol/http/client/request.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2016 Glyn Matthews.
// 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)

#if !defined(BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_REQUEST_INC)
#define BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_REQUEST_INC

#include <boost/network/protocol/http/impl/request.hpp>

namespace boost {
namespace network {
namespace http {
using client_request = basic_request<tags::http_async_8bit_tcp_resolve>;
} // namespace http
} // namespace network
} // namespace boost

#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_REQUEST_INC
19 changes: 19 additions & 0 deletions boost/network/protocol/http/client/response.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2016 Glyn Matthews.
// 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)

#if !defined(BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_RESPONSE_INC)
#define BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_RESPONSE_INC

#include <boost/network/protocol/http/response.hpp>

namespace boost {
namespace network {
namespace http {
using client_response = basic_response<tags::http_async_8bit_tcp_resolve>;
} // namespace http
} // namespace network
} // namespace boost

#endif // BOOST_NETWORK_PROTOCOL_HTTP_CLIENT_RESPONSE_INC
6 changes: 1 addition & 5 deletions boost/network/protocol/http/impl/request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace http {
*/
template <class Tag>
struct basic_request : public basic_message<Tag> {
mutable boost::network::uri::uri uri_;
boost::network::uri::uri uri_;
std::uint16_t source_port_;
typedef basic_message<Tag> base_type;

Expand All @@ -65,10 +65,6 @@ struct basic_request : public basic_message<Tag> {
explicit basic_request(boost::network::uri::uri const& uri_)
: uri_(uri_), source_port_(0) {}

void uri(string_type const& new_uri) { uri_ = new_uri; }

void uri(boost::network::uri::uri const& new_uri) { uri_ = new_uri; }

basic_request() : base_type(), source_port_(0) {}

basic_request(basic_request const& other)
Expand Down
75 changes: 0 additions & 75 deletions boost/network/protocol/http/server/impl/parsers.ipp

This file was deleted.

Loading