Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2af5fb0

Browse files
committed
Cleaning up tag dispatch of HTTP-specific modifiers.
1 parent3133d24 commit2af5fb0

File tree

3 files changed

+33
-39
lines changed

3 files changed

+33
-39
lines changed

‎boost/network/protocol/http/message/modifiers/body.hpp‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ namespace boost { namespace network { namespace http {
3333
response.body(future);
3434
}
3535

36-
template<classTag,classT>
37-
voidbody(basic_request<Tag> & request, Tconst & value, tags::serverconst &) {
38-
request.body = value;
39-
}
40-
41-
template<classTag,classT>
42-
voidbody(basic_request<Tag> & request, Tconst & value, tags::clientconst &) {
43-
request << ::boost::network::body(value);
44-
}
45-
4636
}
4737

4838
template<classTag,classT>
@@ -54,16 +44,13 @@ namespace boost { namespace network { namespace http {
5444
template<classTag,classT>
5545
inlinevoid
5646
body_impl(basic_request<Tag> & request, Tconst & value, tags::server) {
57-
impl::body(request, value,Tag());
47+
request.body = value;
5848
}
5949

60-
template<classR>
61-
structClientRequest;
62-
6350
template<classTag,classT>
6451
inlinevoid
6552
body_impl(basic_request<Tag> & request, Tconst & value, tags::client) {
66-
impl::body(request,value,Tag());
53+
request << ::boost::network::body(value);
6754
}
6855

6956
template<classTag,classT>

‎boost/network/protocol/http/message/modifiers/clear_headers.hpp‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_CLEAR_HEADER_HPP_20101128
22
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_CLEAR_HEADER_HPP_20101128
33

4+
// Copyright 2010 Dean Michael Berris.
5+
// Distributed under the Boost Software License, Version 1.0.
6+
// (See accompanying file LICENSE_1_0.txt or copy at
7+
// http://www.boost.org/LICENSE_1_0.txt)
8+
49
#include<boost/network/protocol/http/support/client_or_server.hpp>
10+
#include<boost/network/support/pod_or_normal.hpp>
511
#include<boost/network/support/is_async.hpp>
612
#include<boost/thread/future.hpp>
713

814
namespaceboost {namespacenetwork {namespacehttp {
915

10-
namespaceimpl {
11-
12-
template<classTag>
13-
inlinetypename enable_if<
14-
is_client<Tag>
15-
,void
16-
>::type
17-
clear_headers(basic_request<Tag> & request) {
18-
request.headers(typename basic_request<Tag>::headers_container_type());
19-
}
16+
template<classTag>
17+
inlinevoidclear_headers_impl(basic_request<Tag> & request, tags::pod) {
18+
typedeftypename basic_request<Tag>::headers_container_type headers_container;
19+
headers_container().swap(request.headers);
20+
}
2021

21-
}/* impl*/
22+
template<classTag>
23+
inlinevoidclear_headers_impl(basic_request<Tag> & request, tags::normal) {
24+
request.headers(typename basic_request<Tag>::headers_container_type());
25+
}
2226

2327
template<classTag>
2428
inlinevoidclear_headers_impl(basic_request<Tag> & request, tags::client) {
25-
impl::clear_headers(request);
29+
clear_headers_impl(request,typename pod_or_normal<Tag>::type());
2630
}
2731

2832
template<classTag>

‎boost/network/protocol/http/message/modifiers/destination.hpp‎

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// http://www.boost.org/LICENSE_1_0.txt)
88

99
#include<boost/network/protocol/http/support/client_or_server.hpp>
10+
#include<boost/network/support/pod_or_normal.hpp>
1011
#include<boost/network/support/is_async.hpp>
1112
#include<boost/thread/future.hpp>
1213
#include<boost/concept/requires.hpp>
@@ -31,16 +32,6 @@ namespace boost { namespace network { namespace http {
3132
response.destination(future);
3233
}
3334

34-
template<classTag,classT>
35-
voiddestination(basic_request<Tag> & request, Tconst & value, tags::serverconst &) {
36-
request.destination = value;
37-
}
38-
39-
template<classTag,classT>
40-
voiddestination(basic_request<Tag> & request, Tconst & value, tags::clientconst &) {
41-
request << ::boost::network::destination(value);
42-
}
43-
4435
}
4536

4637
template<classTag,classT>
@@ -55,13 +46,25 @@ namespace boost { namespace network { namespace http {
5546
template<classTag,classT>
5647
inlinevoid
5748
destination_impl(basic_request<Tag> & request, Tconst & value, tags::server) {
58-
impl::destination(request, value,Tag());
49+
request.destination = value;
50+
}
51+
52+
template<classTag,classT>
53+
inlinevoid
54+
destination_impl(basic_request<Tag> & request, Tconst & value, tags::pod) {
55+
request.destination = value;
56+
}
57+
58+
template<classTag,classT>
59+
inlinevoid
60+
destination_impl(basic_request<Tag> & request, Tconst & value, tags::normal) {
61+
request.destination(value);
5962
}
6063

6164
template<classTag,classT>
6265
inlinevoid
6366
destination_impl(basic_request<Tag> & request, Tconst & value, tags::client) {
64-
impl::destination(request, value,Tag());
67+
destination_impl(request, value,typename pod_or_normal<Tag>::type());
6568
}
6669

6770
template<classTag,classT>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp