mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Send PLUGLOG_CONNECT_SUCCESS in proxied socket types.
Now the non-SSH backends critically depend on it, it's important not to forget to send it, for any socket type that's going to be used for any of those backends. But ProxySocket, and the Unix and Windows 'socket' types wrapping pipes to local subprocesses, were not doing so. Some of these socket types don't have a SockAddr available to represent the destination host. (Sometimes the concept isn't even meaningful). Therefore, I've also expanded the semantics of PLUGLOG_CONNECT_SUCCESS so that the addr parameter is allowed to be NULL, and invented a noncommittal fallback version of the log message in that situation.
This commit is contained in:
@ -314,6 +314,12 @@ static const SocketVtable HandleSocket_sockvt = {
|
||||
.peer_info = sk_handle_peer_info,
|
||||
};
|
||||
|
||||
static void sk_handle_connect_success_callback(void *ctx)
|
||||
{
|
||||
HandleSocket *hs = (HandleSocket *)ctx;
|
||||
plug_log(hs->plug, PLUGLOG_CONNECT_SUCCESS, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H,
|
||||
Plug *plug, bool overlapped)
|
||||
{
|
||||
@ -339,5 +345,7 @@ Socket *make_handle_socket(HANDLE send_H, HANDLE recv_H, HANDLE stderr_H,
|
||||
|
||||
hs->defer_close = hs->deferred_close = false;
|
||||
|
||||
queue_toplevel_callback(sk_handle_connect_success_callback, hs);
|
||||
|
||||
return &hs->sock;
|
||||
}
|
||||
|
Reference in New Issue
Block a user