|
16 | 16 | namespace boost { namespace network { namespace http {
|
17 | 17 |
|
18 | 18 | template <class R>
|
19 |
| - struct PodServerRequest |
20 |
| - : boost::network::Message<R> |
| 19 | + struct ServerRequest |
21 | 20 | {
|
22 | 21 | typedef typename R::string_type string_type;
|
| 22 | + typedef typename R::tag tag; |
| 23 | + typedef typename R::headers_container_type headers_container_type; |
| 24 | + |
| 25 | + BOOST_CONCEPT_USAGE(ServerRequest) { |
| 26 | + string_type source_, method_, destination_; |
| 27 | + boost::uint8_t major_version_, minor_version_; |
| 28 | + headers_container_type headers_; |
| 29 | + string_type body_; |
| 30 | + |
| 31 | + source_ = source(request); |
| 32 | + method_ = method(request); |
| 33 | + destination_ = destination(request); |
| 34 | + major_version_ = major_version(request); |
| 35 | + minor_version_ = minor_version(request); |
| 36 | + headers_ = headers(request); |
| 37 | + body_ = body(request); |
| 38 | + |
| 39 | + source(request, source_); |
| 40 | + method(request, method_); |
| 41 | + destination(request, destination_); |
| 42 | + major_version(request, major_version_); |
| 43 | + minor_version(request, minor_version_); |
| 44 | + headers(request, headers_); |
| 45 | + body(request, body_); |
| 46 | + |
| 47 | + string_type name, value; |
| 48 | + |
| 49 | + request << ::boost::network::source(source_) |
| 50 | + << ::boost::network::destination(destination_) |
| 51 | + << ::boost::network::http::method(method_) |
| 52 | + << ::boost::network::http::major_version(major_version_) |
| 53 | + << ::boost::network::http::minor_version(minor_version_) |
| 54 | + << ::boost::network::header(name, value) |
| 55 | + << ::boost::network::remove_header(name) |
| 56 | + << ::boost::network::http::body(body_); |
| 57 | + |
| 58 | + (void)source_;(void)method_;(void)destination_; |
| 59 | + (void)major_version_;(void)minor_version_;(void)headers_; |
| 60 | + (void)body_;(void)name;(void)value; |
| 61 | + } |
23 | 62 |
|
24 | 63 | private:
|
25 | 64 | R request;
|
26 | 65 | };
|
27 | 66 |
|
28 | 67 | template <class R>
|
29 |
| - struct NormalClientRequest |
| 68 | + struct ClientRequest |
30 | 69 | : boost::network::Message<R>
|
31 | 70 | {
|
32 | 71 | typedef typename R::string_type string_type;
|
33 | 72 | typedef typename R::port_type port_type;
|
34 | 73 |
|
35 |
| - BOOST_CONCEPT_USAGE(NormalClientRequest) { |
| 74 | + BOOST_CONCEPT_USAGE(ClientRequest) { |
36 | 75 | string_type tmp;
|
37 | 76 | R request_(tmp);
|
38 | 77 | swap(request, request_); // swappable via ADL
|
@@ -60,18 +99,6 @@ namespace boost { namespace network { namespace http {
|
60 | 99 | R request;
|
61 | 100 | };
|
62 | 101 |
|
63 |
| - template <class R> |
64 |
| - struct Request : |
65 |
| - mpl::if_< |
66 |
| - is_base_of< |
67 |
| - tags::pod, |
68 |
| - typename R::tag |
69 |
| - >, |
70 |
| - boost::network::Message<R>, |
71 |
| - NormalClientRequest<R> |
72 |
| - >::type |
73 |
| - {}; |
74 |
| - |
75 | 102 | } // namespace http
|
76 | 103 |
|
77 | 104 | } // namespace network
|
|
0 commit comments