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

Commitb542d50

Browse files
committed
Incremental Progress on HTTP Message
This time I've gotten all the tests to start building and linking. Nowit's the long road ahead to getting all the tests passing.There's a number of API changes that need to be documented too. Thetests are now using opaque types and the virtual interfaces are cleardelineations for extension. At some point implementations of differentkinds of connection managers, connection delegates, connections(websocket, spdy, proxied http, etc.), and other things would be nice tohave.The next step probably is to get some sort of mocking around theconnections so that the HTTP parsing/handling logic can be handledproperly. Fake implementations of the connections now that they'reproperly virtualized are going to be the other main focus going forward.
1 parent82bba85 commitb542d50

File tree

7 files changed

+108
-22
lines changed

7 files changed

+108
-22
lines changed

‎boost/network/protocol/http/message/wrappers/status.hpp‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,17 @@
1111

1212
namespaceboost {namespacenetwork {namespacehttp {
1313

14-
namespaceimpl {
15-
1614
structstatus_wrapper {
17-
explicitstatus_wrapper(response_base & response_);
18-
operatorstd::string ()const;
15+
explicitstatus_wrapper(response_base & response);
1916
operatoruint16_t ()const;
2017
private:
2118
response_base & response_;
2219
};
2320

24-
}// namespace impl
25-
2621
inline
27-
impl::status_wrapper
22+
status_wrapperconst
2823
status(response_base & response) {
29-
returnimpl::status_wrapper(response);
24+
returnstatus_wrapper(response);
3025
}
3126

3227
}// namespace http
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_IPP_20120311
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_IPP_20120311
3+
4+
// Copyright 2012 Dean Michael Berris <dberris@google.com>.
5+
// Copyright 2012 Google, Inc.
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/protocol/http/message/wrappers/status.hpp>
11+
12+
namespaceboost {namespacenetwork {namespacehttp {
13+
14+
status_wrapper::status_wrapper(response_base &response)
15+
: response_(response_)
16+
{}
17+
18+
status_wrapper::operatoruint16_t ()const {
19+
uint16_t status;
20+
response_.get_status(status);
21+
return status;
22+
}
23+
24+
}// namespace http
25+
26+
}// namespace network
27+
28+
}// namespace boost
29+
30+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_IPP_20120311

‎boost/network/protocol/http/message/wrappers/status_message.hpp‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
namespaceboost {namespacenetwork {namespacehttp {
1313

14-
namespaceimpl {
15-
1614
structstatus_message_wrapper {
17-
explicitstatus_message_wrapper(response_base &response_);
15+
explicitstatus_message_wrapper(response_base &response);
1816
operatorstd::string ()const;
1917
private:
2018
response_base & response_;
@@ -25,12 +23,10 @@ inline std::ostream & operator<<(std::ostream & os, status_message_wrapper const
2523
return os <<static_cast<std::string>(status_message);
2624
}
2725

28-
}// namespace impl
29-
3026
inline
31-
impl::status_message_wrapper
27+
status_message_wrapper
3228
status_message(response_base & response) {
33-
returnimpl::status_message_wrapper(response);
29+
returnstatus_message_wrapper(response);
3430
}
3531

3632
}// namespace http
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_MESSAGE_IPP_20120311
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_MESSAGE_IPP_20120311
3+
4+
// Copyright 2012 Dean Michael Berris <dberris@google.com>.
5+
// Copyright 2012 Google, Inc.
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/protocol/http/message/wrappers/status_message.hpp>
11+
12+
namespaceboost {namespacenetwork {namespacehttp {
13+
14+
status_message_wrapper::status_message_wrapper(response_base &response)
15+
: response_(response)
16+
{}
17+
18+
status_message_wrapper::operatorstd::string ()const {
19+
if (cache_)return *cache_;
20+
std::string tmp;
21+
response_.get_status_message(tmp);
22+
cache_ = tmp;
23+
return *cache_;
24+
}
25+
26+
}// namespace http
27+
28+
}// namespace network
29+
30+
}// namespace boost
31+
32+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_STATUS_MESSAGE_IPP_20120311

‎boost/network/protocol/http/message/wrappers/version.hpp‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_VERSION_HPP_20100603
22
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_VERSION_HPP_20100603
33

4-
// Copyright 2010 (c) Dean Michael Berris
4+
// Copyright 2010-2012 (c) Dean Michael Berris
55
// Copyright 2010 (c) Sinefunc, Inc.
6+
// Copyright 2012 Google, Inc.
67
// Distributed under the Boost Software License, Version 1.0.
78
// (See accompanying file LICENSE_1_0.txt or copy at
89
// http://www.boost.org/LICENSE_1_0.txt)
@@ -11,8 +12,6 @@
1112

1213
namespaceboost {namespacenetwork {namespacehttp {
1314

14-
namespaceimpl {
15-
1615
structversion_wrapper {
1716
explicitversion_wrapper(response_base & response_);
1817
operatorstd::string()const;
@@ -25,12 +24,10 @@ inline std::ostream & operator<< (std::ostream & os, version_wrapper const & ver
2524
return os <<static_cast<std::string>(version);
2625
}
2726

28-
}// namespace impl
29-
3027
inline
31-
impl::version_wrapper
28+
version_wrapper
3229
version(response_base & response) {
33-
returnimpl::version_wrapper(response);
30+
returnversion_wrapper(response);
3431
}
3532

3633
}// namespace http
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_VERSION_IPP_20120311
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_VERSION_IPP_20120311
3+
4+
// Copyright 2012 Dean Michael Berris <dberris@google.com>.
5+
// Copyright 2012 Google, Inc.
6+
// Distributed under the Boost Software License, Version 1.0.
7+
// (See accompanying file LICENSE_1_0.txt or copy at
8+
// http://www.boost.org/LICENSE_1_0.txt)
9+
10+
#include<boost/network/protocol/http/message/wrappers/version.hpp>
11+
12+
namespaceboost {namespacenetwork {namespacehttp {
13+
14+
version_wrapper::version_wrapper(response_base & response)
15+
: response_(response)
16+
{}
17+
18+
version_wrapper::operatorstd::string()const {
19+
if (cache_)return *cache_;
20+
std::string tmp;
21+
response_.get_version(tmp);
22+
cache_ = tmp;
23+
return *cache_;
24+
}
25+
26+
}// namespace http
27+
28+
}// namespace network
29+
30+
}// namespace boost
31+
32+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_WRAPPERS_VERSION_IPP_20120311

‎libs/network/src/http/response.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@
1010

1111
#include<boost/network/protocol/http/response/response_base.ipp>
1212
#include<boost/network/protocol/http/response/response.ipp>
13+
14+
#include<boost/network/protocol/http/message/wrappers/status.ipp>
15+
#include<boost/network/protocol/http/message/wrappers/status_message.ipp>
16+
#include<boost/network/protocol/http/message/wrappers/version.ipp>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp