Skip to content

Commit 620a0c5

Browse files
committed
Merge pull request cpp-netlib#613 from deanberris/document-client-options
Document client options
2 parents fb9d8fa + d9ed6d9 commit 620a0c5

File tree

8 files changed

+545
-891
lines changed

8 files changed

+545
-891
lines changed

boost/network/protocol/http/client/options.hpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class client_options {
2121
public:
2222
typedef typename string<Tag>::type string_type;
2323

24+
/// Set all the options to default.
2425
client_options()
2526
: cache_resolved_(false),
2627
follow_redirects_(false),
@@ -32,7 +33,7 @@ class client_options {
3233
openssl_sni_hostname_(),
3334
openssl_options_(0),
3435
io_service_(),
35-
always_verify_peer_(false),
36+
always_verify_peer_(true),
3637
timeout_(0) {}
3738

3839
client_options(client_options const& other)
@@ -70,61 +71,84 @@ class client_options {
7071
swap(timeout_, other.timeout_);
7172
}
7273

74+
/// Specify whether the client should cache resolved endpoints.
75+
///
76+
/// Default: false.
7377
client_options& cache_resolved(bool v) {
7478
cache_resolved_ = v;
7579
return *this;
7680
}
7781

82+
/// Specify whether the client should follow redirects.
83+
///
84+
/// Default: false.
85+
/// \deprecated Not supported by asynchronous client implementation.
7886
client_options& follow_redirects(bool v) {
7987
follow_redirects_ = v;
8088
return *this;
8189
}
8290

91+
/// Set the filename of the certificate to load for the SSL connection for
92+
/// verification.
8393
client_options& openssl_certificate(string_type const& v) {
8494
openssl_certificate_ = v;
8595
return *this;
8696
}
8797

98+
/// Set the directory for which the certificate authority files are located.
8899
client_options& openssl_verify_path(string_type const& v) {
89100
openssl_verify_path_ = v;
90101
return *this;
91102
}
92103

104+
/// Set the filename of the certificate to use for client-side SSL session
105+
/// establishment.
93106
client_options& openssl_certificate_file(string_type const& v) {
94107
openssl_certificate_file_ = v;
95108
return *this;
96109
}
97110

111+
/// Set the filename of the private key to use for client-side SSL session
112+
/// establishment.
98113
client_options& openssl_private_key_file(string_type const& v) {
99114
openssl_private_key_file_ = v;
100115
return *this;
101116
}
102117

118+
/// Set the ciphers to support for SSL negotiation.
103119
client_options& openssl_ciphers(string_type const& v) {
104120
openssl_ciphers_ = v;
105121
return *this;
106122
}
107123

124+
/// Set the hostname for SSL SNI hostname support.
108125
client_options& openssl_sni_hostname(string_type const& v) {
109126
openssl_sni_hostname_ = v;
110127
return *this;
111128
}
112129

130+
/// Set the raw OpenSSL options to use for HTTPS requests.
113131
client_options& openssl_options(long o) {
114132
openssl_options_ = o;
115133
return *this;
116134
}
117135

136+
/// Provide an `asio::io_service` hosted in a shared pointer.
118137
client_options& io_service(std::shared_ptr<asio::io_service> v) {
119138
io_service_ = v;
120139
return *this;
121140
}
122141

142+
/// Set whether we always verify the peer on the other side of the HTTPS
143+
/// connection.
144+
///
145+
/// Default: true.
123146
client_options& always_verify_peer(bool v) {
124147
always_verify_peer_ = v;
125148
return *this;
126149
}
127150

151+
/// Set an overall timeout for HTTP requests.
128152
client_options& timeout(int v) {
129153
timeout_ = v;
130154
return *this;

libs/network/doc/html/_sources/reference/http_client.txt

Lines changed: 28 additions & 280 deletions
Large diffs are not rendered by default.

libs/network/doc/html/contents.html

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,14 @@ <h3>Navigation</h3>
190190
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html">HTTP Client API</a><ul>
191191
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#general">General</a></li>
192192
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#features">Features</a></li>
193-
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#implementations">Implementations</a><ul>
194-
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#synchronous-clients">Synchronous Clients</a></li>
195-
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#asynchronous-clients">Asynchronous Clients</a></li>
196-
</ul>
197-
</li>
193+
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#client-implementation">Client Implementation</a></li>
198194
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#member-functions">Member Functions</a><ul>
199195
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#constructors">Constructors</a></li>
196+
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#client-options">Client Options</a></li>
200197
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#http-methods">HTTP Methods</a></li>
201-
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#client-specific">Client-Specific</a></li>
202198
<li class="toctree-l4"><a class="reference internal" href="reference/http_client.html#streaming-body-handler">Streaming Body Handler</a></li>
203199
</ul>
204200
</li>
205-
<li class="toctree-l3"><a class="reference internal" href="reference/http_client.html#generated-documentation">Generated Documentation</a></li>
206201
</ul>
207202
</li>
208203
<li class="toctree-l2"><a class="reference internal" href="reference/http_request.html">HTTP Request</a><ul>

libs/network/doc/html/objects.inv

1.39 KB
Binary file not shown.

libs/network/doc/html/reference.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ <h3>Navigation</h3>
6262
<li class="toctree-l1"><a class="reference internal" href="reference/http_client.html">HTTP Client API</a><ul>
6363
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#general">General</a></li>
6464
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#features">Features</a></li>
65-
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#implementations">Implementations</a></li>
65+
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#client-implementation">Client Implementation</a></li>
6666
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#member-functions">Member Functions</a></li>
67-
<li class="toctree-l2"><a class="reference internal" href="reference/http_client.html#generated-documentation">Generated Documentation</a></li>
6867
</ul>
6968
</li>
7069
<li class="toctree-l1"><a class="reference internal" href="reference/http_request.html">HTTP Request</a><ul>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy