0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00

In HTTP client, added http_post_connect() virtual callback method to allow user to verify server socket immediately after connect. This is useful when the server is local via a unix domain socket or windows named pipe.

In WS::ClientSet, exposed the callback as a std::function
in TransactionSet::post_connect.
This commit is contained in:
James Yonan 2015-10-18 17:26:27 -07:00 committed by Lev Stipakov
parent 0a697e21d7
commit 76fe2a9061
No known key found for this signature in database
GPG Key ID: 88670BE258B9C258

View File

@ -227,6 +227,10 @@ namespace openvpn {
// completion method
std::function<void(TransactionSet& ts)> completion;
// post-connect method, useful to validate server
// on local sockets
std::function<void(TransactionSet& ts, AsioPolySock::Base& sock)> post_connect;
// Persistent state (can be reused).
// hsc.reset() can be called to explicitly
// close persistent state.
@ -580,6 +584,12 @@ namespace openvpn {
// this is a no-op because ts->hsc.alive() is always tested before construction
}
void http_post_connect(HTTPDelegate& hd, AsioPolySock::Base& sock)
{
if (ts->post_connect)
ts->post_connect(*ts, sock);
}
ClientSet* parent;
TransactionSet::Ptr ts;
TransactionSet::Vector::const_iterator ts_iter;