mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 09:12:24 +00:00
windows: Make select_result() return void.
Nothing now uses its return value anyway.
This commit is contained in:
parent
70e2e140f0
commit
a2fb1d96ef
@ -1625,9 +1625,9 @@ static void sk_tcp_write_eof(Socket sock)
|
|||||||
try_send(s);
|
try_send(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
int select_result(WPARAM wParam, LPARAM lParam)
|
void select_result(WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
int ret, open;
|
int ret;
|
||||||
DWORD err;
|
DWORD err;
|
||||||
char buf[20480]; /* nice big buffer for plenty of speed */
|
char buf[20480]; /* nice big buffer for plenty of speed */
|
||||||
Actual_Socket s;
|
Actual_Socket s;
|
||||||
@ -1636,11 +1636,11 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
/* wParam is the socket itself */
|
/* wParam is the socket itself */
|
||||||
|
|
||||||
if (wParam == 0)
|
if (wParam == 0)
|
||||||
return 1; /* boggle */
|
return; /* boggle */
|
||||||
|
|
||||||
s = find234(sktree, (void *) wParam, cmpforsearch);
|
s = find234(sktree, (void *) wParam, cmpforsearch);
|
||||||
if (!s)
|
if (!s)
|
||||||
return 1; /* boggle */
|
return; /* boggle */
|
||||||
|
|
||||||
if ((err = WSAGETSELECTERROR(lParam)) != 0) {
|
if ((err = WSAGETSELECTERROR(lParam)) != 0) {
|
||||||
/*
|
/*
|
||||||
@ -1657,9 +1657,8 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (err != 0)
|
if (err != 0)
|
||||||
return plug_closing(s->plug, winsock_error_string(err), err, 0);
|
plug_closing(s->plug, winsock_error_string(err), err, 0);
|
||||||
else
|
return;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
noise_ultralight(lParam);
|
noise_ultralight(lParam);
|
||||||
@ -1712,12 +1711,11 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return plug_closing(s->plug, winsock_error_string(err), err,
|
plug_closing(s->plug, winsock_error_string(err), err, 0);
|
||||||
0);
|
|
||||||
} else if (0 == ret) {
|
} else if (0 == ret) {
|
||||||
return plug_closing(s->plug, NULL, 0, 0);
|
plug_closing(s->plug, NULL, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
return plug_receive(s->plug, atmark ? 0 : 1, buf, ret);
|
plug_receive(s->plug, atmark ? 0 : 1, buf, ret);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FD_OOB:
|
case FD_OOB:
|
||||||
@ -1737,7 +1735,7 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
logevent(NULL, str);
|
logevent(NULL, str);
|
||||||
fatalbox("%s", str);
|
fatalbox("%s", str);
|
||||||
} else {
|
} else {
|
||||||
return plug_receive(s->plug, 2, buf, ret);
|
plug_receive(s->plug, 2, buf, ret);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FD_WRITE:
|
case FD_WRITE:
|
||||||
@ -1753,23 +1751,20 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
case FD_CLOSE:
|
case FD_CLOSE:
|
||||||
/* Signal a close on the socket. First read any outstanding data. */
|
/* Signal a close on the socket. First read any outstanding data. */
|
||||||
open = 1;
|
|
||||||
do {
|
do {
|
||||||
ret = p_recv(s->s, buf, sizeof(buf), 0);
|
ret = p_recv(s->s, buf, sizeof(buf), 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
err = p_WSAGetLastError();
|
err = p_WSAGetLastError();
|
||||||
if (err == WSAEWOULDBLOCK)
|
if (err == WSAEWOULDBLOCK)
|
||||||
break;
|
break;
|
||||||
return plug_closing(s->plug, winsock_error_string(err),
|
plug_closing(s->plug, winsock_error_string(err), err, 0);
|
||||||
err, 0);
|
|
||||||
} else {
|
} else {
|
||||||
if (ret)
|
if (ret)
|
||||||
open &= plug_receive(s->plug, 0, buf, ret);
|
plug_receive(s->plug, 0, buf, ret);
|
||||||
else
|
else
|
||||||
open &= plug_closing(s->plug, NULL, 0, 0);
|
plug_closing(s->plug, NULL, 0, 0);
|
||||||
}
|
}
|
||||||
} while (ret > 0);
|
} while (ret > 0);
|
||||||
return open;
|
|
||||||
case FD_ACCEPT:
|
case FD_ACCEPT:
|
||||||
{
|
{
|
||||||
#ifdef NO_IPV6
|
#ifdef NO_IPV6
|
||||||
@ -1807,8 +1802,6 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -284,7 +284,7 @@ GLOBAL void *logctx;
|
|||||||
/*
|
/*
|
||||||
* Exports from winnet.c.
|
* Exports from winnet.c.
|
||||||
*/
|
*/
|
||||||
extern int select_result(WPARAM, LPARAM);
|
extern void select_result(WPARAM, LPARAM);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* winnet.c dynamically loads WinSock 2 or WinSock 1 depending on
|
* winnet.c dynamically loads WinSock 2 or WinSock 1 depending on
|
||||||
|
Loading…
Reference in New Issue
Block a user