26#ifndef MYSQLROUTER_HTTP_CLIENT_INCLUDED
27#define MYSQLROUTER_HTTP_CLIENT_INCLUDED
35struct evhttp_connection;
70 const std::string &uri,
73 const std::string &uri,
82 operator bool()
const;
89 std::string error_msg()
const;
110 event_base *ev_base()
const;
124 const std::string &address, uint16_t
port);
130 : io_ctx_{io_ctx}, hostname_{hostname}, port_{
port} {}
141 const std::string &uri);
147 const std::string &uri);
154 operator bool()
const;
161 std::string error_msg()
const;
171 uint16_t
port()
const {
return port_; }
174 virtual std::unique_ptr<HttpClientConnectionBase> make_connection();
180 std::unique_ptr<HttpClientConnectionBase>
conn_;
186 const std::string &address, uint16_t
port)
190 std::unique_ptr<HttpClientConnectionBase> make_connection()
override;
Definition: http_client.h:65
std::unique_ptr< impl > pImpl_
Definition: http_client.h:99
std::error_code socket_errno() const
last socket errno.
Definition: http_client.h:94
std::error_code socket_errno_
Definition: http_client.h:105
~HttpClientConnectionBase()
IOContext & io_ctx_
Definition: http_client.h:103
Definition: http_client.h:114
Definition: http_client.h:127
uint16_t port_
Definition: http_client.h:178
IOContext & io_ctx_
Definition: http_client.h:176
uint16_t port() const
TCP port to connect to.
Definition: http_client.h:171
std::string hostname() const
hostname to connect to.
Definition: http_client.h:166
std::unique_ptr< HttpClientConnectionBase > conn_
Definition: http_client.h:180
const std::string hostname_
Definition: http_client.h:177
HttpClient(IOContext &io_ctx, const std::string &hostname, uint16_t port)
Definition: http_client.h:129
a HTTP request and response.
Definition: http_request.h:453
Definition: http_client.h:121
Definition: http_client.h:183
TlsClientContext tls_ctx_
Definition: http_client.h:192
HttpsClient(IOContext &io_ctx, TlsClientContext &&tls_ctx, const std::string &address, uint16_t port)
Definition: http_client.h:185
IO Context for network operations.
Definition: http_client.h:43
std::unique_ptr< impl > pImpl_
Definition: http_client.h:59
Client TLS Context.
Definition: tls_client_context.h:39
#define HTTP_CLIENT_EXPORT
Definition: http_client_export.h:40
int type
Definition: http_request.h:253
Definition: authentication.cc:36
static bool timeout(bool(*wait_condition)())
Timeout function.
Definition: log0meb.cc:496
auto dispatch(CompletionToken &&token)
Definition: executor.h:718
Definition: gcs_xcom_synode.h:64
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
double seconds()
Definition: task.cc:310