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

Commit71757f1

Browse files
committed
Updated client sources, adding some more tests.
1 parent4eac522 commit71757f1

14 files changed

+110
-6
lines changed
File renamed without changes.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (C) 2013 by Glyn Matthews
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __NETWORK_HTTP_V2_CLIENT_CONNECTION_INC__
8+
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_INC__
9+
10+
#include<memory>
11+
#include<functional>
12+
#include<boost/utility/string_ref.hpp>
13+
14+
namespacenetwork {
15+
namespacehttp {
16+
namespacev2 {
17+
18+
classresponse;
19+
classrequest;
20+
classrequest_options;
21+
22+
classconnection {
23+
24+
public:
25+
26+
typedef std::function<void (boost::string_ref, boost::system::error_code)> callback_type;
27+
28+
connection() =default;
29+
30+
connection(const connection &) =delete;
31+
32+
connection &operator = (const connection &) =delete;
33+
34+
virtualconnection() = default;
35+
36+
virtual responsesend_request(std::string method,
37+
request req,
38+
bool get_body,
39+
callback_type callback,
40+
request_options) = 0;
41+
42+
virtualvoidreset() = 0;
43+
44+
};
45+
}// namespace v2
46+
}// namespace http
47+
}// namespace network
48+
49+
50+
#endif// __NETWORK_HTTP_V2_CLIENT_CONNECTION_INC__
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright (C) 2013 by Glyn Matthews
2+
// Distributed under the Boost Software License, Version 1.0.
3+
// (See accompanying file LICENSE_1_0.txt or copy at
4+
// http://www.boost.org/LICENSE_1_0.txt)
5+
6+
7+
#ifndef __NETWORK_HTTP_V2_CLIENT_CONNECTION_MANAGER_INC__
8+
#define__NETWORK_HTTP_V2_CLIENT_CONNECTION_MANAGER_INC__
9+
10+
#include<memory>
11+
#include<boost/asio/io_service.hpp>
12+
13+
namespacenetwork {
14+
namespacehttp {
15+
namespacev2 {
16+
17+
classrequest;
18+
classclient_connection;
19+
classclient_options;
20+
21+
classconnection_manager {
22+
23+
public:
24+
25+
connection_manager() =default;
26+
27+
connection_manager(const connection_manager &) =delete;
28+
29+
connection_manager &operator = (const connection_manager &) =delete;
30+
31+
virtualconnection_manager() = default;
32+
33+
virtual std::shared_ptr<client_connection>get_connection(boost::asio::io_service &io_service,
34+
const request &req,
35+
const client_options &options) = 0;
36+
37+
virtualvoidclear_resolved_cache() = 0;
38+
39+
virtualvoidreset() = 0;
40+
41+
};
42+
}// namespace v2
43+
}// namespace http
44+
}// namespace network
45+
46+
47+
#endif// __NETWORK_HTTP_V2_CLIENT_CONNECTION_MANAGER_INC__

‎http/src/network/http/v2/request.hpp‎renamed to ‎http/src/network/http/v2/client/request.hpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include<cstdint>
1010
#include<memory>
1111
#include<network/uri.hpp>
12-
#include<network/http/v2/byte_source.hpp>
12+
#include<network/http/v2/client/byte_source.hpp>
1313

1414
namespacenetwork {
1515
namespacehttp {

‎http/test/v2/client/byte_source_test.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include<gtest/gtest.h>
7-
#include<network/http/v2/byte_source.hpp>
7+
#include<network/http/v2/client/byte_source.hpp>
88

99

‎http/test/v2/client/client_options_test.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// http://www.boost.org/LICENSE_1_0.txt)
55

66
#include<gtest/gtest.h>
7-
#include<network/http/v2/client_options.hpp>
7+
#include<network/http/v2/client/client_options.hpp>
88

99
TEST(client_options_test, default_options_follow_redirects) {
1010
network::http::v2::client_options opts;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp