mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
Squashed 'Sources/OpenVPNAdapter/Libraries/Vendors/openvpn/' changes from 6608878d5..934f4e741
934f4e741 Merge remote-tracking branch 'origin/qa' 8c87c7696 [UCONNECT-1027] use proper io_context when initializing AsyncResolve class c3026c65a Merge remote-tracking branch 'origin/qa' f33fe7665 [UCONNECT-1027] perform async DNS resolution in a detached thread 0c0af6781 [OVPN3-342] Generate ICMP "packet too big" reply c93af60a7 Move files from ovpn3-common to openvpn3 repo d5eeb78ed ClientAPI: print core version when starting 04de9c425 Merge branch 'qa' 2c0dbc6c3 buildep.py: add asio patching 600c68012 Allow updating auth-token during session 7391096b9 [OC-85] tunprop: exclude routes for additional remotes also on macOS 3587628d7 [OC-84] tunprop: exclude routes for additional remotes also on Windows 25471635d Revert "[UCONNECT-868] When no network is present pause instead of stopping" 5713ff34a Fixed some breakage caused by recent endian/ffs commits a9ce44a22 endian.hpp: break out endian compile-time tests to endian_platform.hpp 72181f9e7 [UCONNECT-868] When no network is present pause instead of stopping 10d636cfe version: switch to 3.2 git-subtree-dir: Sources/OpenVPNAdapter/Libraries/Vendors/openvpn git-subtree-split: 934f4e741f760160dc65a6f4b29af57bb5be8f93
This commit is contained in:
@@ -74,7 +74,7 @@ namespace openvpn {
|
||||
{}
|
||||
};
|
||||
|
||||
class Client : public TransportClient
|
||||
class Client : public TransportClient, AsyncResolvableTCP
|
||||
{
|
||||
typedef RCPtr<Client> Ptr;
|
||||
|
||||
@@ -102,12 +102,8 @@ namespace openvpn {
|
||||
else
|
||||
{
|
||||
parent->transport_pre_resolve();
|
||||
resolver.async_resolve(server_host, server_port,
|
||||
[self=Ptr(this)](const openvpn_io::error_code& error, openvpn_io::ip::tcp::resolver::results_type results)
|
||||
{
|
||||
OPENVPN_ASYNC_HANDLER;
|
||||
self->do_resolve_(error, results);
|
||||
});
|
||||
|
||||
async_resolve_name(server_host, server_port);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,7 +171,8 @@ namespace openvpn {
|
||||
Client(openvpn_io::io_context& io_context_arg,
|
||||
ClientConfig* config_arg,
|
||||
TransportClientParent* parent_arg)
|
||||
: io_context(io_context_arg),
|
||||
: AsyncResolvableTCP(io_context_arg),
|
||||
io_context(io_context_arg),
|
||||
socket(io_context_arg),
|
||||
config(config_arg),
|
||||
parent(parent_arg),
|
||||
@@ -249,12 +246,13 @@ namespace openvpn {
|
||||
|
||||
socket.close();
|
||||
resolver.cancel();
|
||||
async_resolve_cancel();
|
||||
}
|
||||
}
|
||||
|
||||
// do DNS resolve
|
||||
void do_resolve_(const openvpn_io::error_code& error,
|
||||
openvpn_io::ip::tcp::resolver::results_type results)
|
||||
void resolve_callback(const openvpn_io::error_code& error,
|
||||
openvpn_io::ip::tcp::resolver::results_type results) override
|
||||
{
|
||||
if (!halt)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user