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

Commit64d7419

Browse files
committed
Merge pull request#349 from deanberris/0.11-devel
Add support for always_verify_peer as an option to HTTP Clients
2 parents8c15fa8 +8d9538f commit64d7419

File tree

17 files changed

+594
-542
lines changed

17 files changed

+594
-542
lines changed

‎.ycm_extra_conf.py‎

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright 2013 Google, Inc.
2+
# Copyright 2013 Dean Michael Berris <dberris@google.com>
3+
# Distributed under the Boost Software License, Version 1.0.
4+
# (See accompanying file LICENSE_1_0.txt or copy at
5+
# http://www.boost.org/LICENSE_1_0.txt)
6+
#
7+
# Project-wide configuration for YouCompleteMe Vim plugin.
8+
#
9+
# Based off of Valloric's .ycm_conf_extra.py for YouCompleteMe:
10+
# https://github.com/Valloric/YouCompleteMe/blob/master/cpp/ycm/.ycm_extra_conf.py
11+
#
12+
13+
importos
14+
importycm_core
15+
16+
flags= [
17+
'-Wall',
18+
'-Wextra',
19+
'-Werror',
20+
'-std=c++03',
21+
'-isystem',
22+
'.',
23+
'-isystem',
24+
'/usr/include',
25+
'-isystem',
26+
'/usr/include/c++/4.6',
27+
'-isystem',
28+
'/usr/include/clang/3.0/include',
29+
'-I',
30+
os.environ['BOOST_ROOT'],
31+
# Always enable debugging for the project when building for semantic
32+
# completion.
33+
'-DBOOST_NETWORK_DEBUG',
34+
]
35+
36+
defDirectoryOfThisScript():
37+
returnos.path.dirname(os.path.abspath(__file__))
38+
39+
40+
defMakeRelativePathsInFlagsAbsolute(flags,working_directory):
41+
ifnotworking_directory:
42+
returnlist(flags)
43+
new_flags= []
44+
make_next_absolute=False
45+
path_flags= ['-isystem','-I','-iquote','--sysroot=']
46+
forflaginflags:
47+
new_flag=flag
48+
ifmake_next_absolute:
49+
make_next_absolute=False
50+
ifnotflag.startswith('/'):
51+
new_flag=os.path.join(working_directory,flag)
52+
53+
forpath_flaginpath_flags:
54+
ifflag==path_flag:
55+
make_next_absolute=True
56+
break
57+
ifflag.startswith(path_flag):
58+
path=flag[len(path_flag):]
59+
new_flag=path_flag+os.path.join(working_directory,path)
60+
break
61+
62+
ifnew_flag:
63+
new_flags.append(new_flag)
64+
returnnew_flags
65+
66+
67+
defFlagsForFile(filename):
68+
relative_to=DirectoryOfThisScript()
69+
final_flags=MakeRelativePathsInFlagsAbsolute(flags,relative_to)
70+
return {'flags':final_flags,'do_cache':True }

‎boost/network/protocol/http/client/async_impl.hpp‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ struct async_client
3636

3737
typedef function<bool(string_type&)> body_generator_function_type;
3838

39-
async_client(bool cache_resolved,
40-
boolfollow_redirect,
39+
async_client(bool cache_resolved,bool follow_redirect,
40+
boolalways_verify_peer,
4141
boost::shared_ptr<boost::asio::io_service> service,
4242
optional<string_type>const& certificate_filename,
4343
optional<string_type>const& verify_path)
@@ -49,7 +49,8 @@ struct async_client
4949
resolver_(service_),
5050
sentinel_(new boost::asio::io_service::work(service_)),
5151
certificate_filename_(certificate_filename),
52-
verify_path_(verify_path) {
52+
verify_path_(verify_path),
53+
always_verify_peer_(always_verify_peer) {
5354
connection_base::resolver_strand_.reset(
5455
newboost::asio::io_service::strand(service_));
5556
lifetime_thread_.reset(newboost::thread(
@@ -65,16 +66,15 @@ struct async_client
6566
}
6667

6768
basic_response<Tag>constrequest_skeleton(
68-
basic_request<Tag>const& request_,
69-
string_typeconst& method,
70-
bool get_body,
71-
body_callback_function_type callback,
69+
basic_request<Tag>const& request_, string_typeconst& method,
70+
bool get_body, body_callback_function_type callback,
7271
body_generator_function_type generator) {
7372
typename connection_base::connection_ptr connection_;
7473
connection_ =connection_base::get_connection(
75-
resolver_, request_, certificate_filename_, verify_path_);
76-
return connection_->send_request(
77-
method, request_, get_body, callback, generator);
74+
resolver_, request_, always_verify_peer_, certificate_filename_,
75+
verify_path_);
76+
return connection_->send_request(method, request_, get_body, callback,
77+
generator);
7878
}
7979

8080
boost::shared_ptr<boost::asio::io_service> service_ptr;
@@ -83,6 +83,7 @@ struct async_client
8383
boost::shared_ptr<boost::asio::io_service::work> sentinel_;
8484
boost::shared_ptr<boost::thread> lifetime_thread_;
8585
optional<string_type> certificate_filename_, verify_path_;
86+
bool always_verify_peer_;
8687
};
8788
}// namespace impl
8889
}// namespace http

‎boost/network/protocol/http/client/connection/async_base.hpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace boost { namespace network { namespace http { namespace impl {
3737
resolve_function resolve,
3838
resolver_type & resolver,
3939
bool follow_redirect,
40+
bool always_verify_peer,
4041
bool https,
4142
optional<string_type> certificate_filename=optional<string_type>(),
4243
optional<string_type>const & verify_path=optional<string_type>()) {
@@ -52,6 +53,7 @@ namespace boost { namespace network { namespace http { namespace impl {
5253
delegate_factory_type::new_connection_delegate(
5354
resolver.get_io_service(),
5455
https,
56+
always_verify_peer,
5557
certificate_filename,
5658
verify_path)));
5759
BOOST_ASSERT(temp.get() !=0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp