1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

The remaining issue in `win-askappend-multi' appears to have been

caused by the MessageBox() internal message loop eating WinSock
FD_READ notifications, which then don't reappear afterwards because
you have to explicitly prod a socket in order to get a repeat
notification on it.

Hence, here's a piece of infrastructure which seems to sort it out:
a new winnet.c function called socket_reselect_all(), whose function
is to go through all currently active sockets and re-run
WSAAsyncSelect() on them, causing repeat notifications for anything
we might have missed. I call this after every call to MessageBox(),
and that seems to solve the problem.

(The problem was actually masked in very recent revisions, probably
by the reinstatement of pending_netevent in r7071. However, I don't
believe that was a complete fix. This should be.)

[originally from svn r7077]
[r7071 == 57a763b0ec]
This commit is contained in:
Simon Tatham
2007-01-08 19:38:39 +00:00
parent bacbc03f9f
commit 6c3f4b3baa
3 changed files with 21 additions and 2 deletions

View File

@ -1473,10 +1473,11 @@ int select_result(WPARAM wParam, LPARAM lParam)
#ifndef NO_IPV6
if (isa.ss_family == AF_INET &&
s->localhost_only &&
!ipv4_is_local_addr(((struct sockaddr_in *)&isa)->sin_addr)) {
!ipv4_is_local_addr(((struct sockaddr_in *)&isa)->sin_addr))
#else
if (s->localhost_only && !ipv4_is_local_addr(isa.sin_addr)) {
if (s->localhost_only && !ipv4_is_local_addr(isa.sin_addr))
#endif
{
p_closesocket(t); /* dodgy WinSock let nonlocal through */
} else if (plug_accepting(s->plug, (void*)t)) {
p_closesocket(t); /* denied or error */
@ -1572,6 +1573,17 @@ static void sk_tcp_set_frozen(Socket sock, int is_frozen)
s->frozen_readable = 0;
}
void socket_reselect_all(void)
{
Actual_Socket s;
int i;
for (i = 0; (s = index234(sktree, i)) != NULL; i++) {
if (!s->frozen)
do_select(s->s, 1);
}
}
/*
* For Plink: enumerate all sockets currently active.
*/