mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12: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:
@ -315,6 +315,12 @@ static const SocketVtable FdSocket_sockvt = {
|
||||
.peer_info = NULL,
|
||||
};
|
||||
|
||||
static void fdsocket_connect_success_callback(void *ctx)
|
||||
{
|
||||
FdSocket *fds = (FdSocket *)ctx;
|
||||
plug_log(fds->plug, PLUGLOG_CONNECT_SUCCESS, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug)
|
||||
{
|
||||
FdSocket *fds;
|
||||
@ -354,5 +360,7 @@ Socket *make_fd_socket(int infd, int outfd, int inerrfd, Plug *plug)
|
||||
uxsel_set(fds->inerrfd, SELECT_R, fdsocket_select_result_input_error);
|
||||
}
|
||||
|
||||
queue_toplevel_callback(fdsocket_connect_success_callback, fds);
|
||||
|
||||
return &fds->sock;
|
||||
}
|
||||
|
Reference in New Issue
Block a user