1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 20:42:48 -05:00

Improve handling of oobinline sockets; Plink in telnet mode now

doesn't hang when you hit ^C, which is nice. I think a better
solution would involve nonblocking sockets; as it stands it's a
little dependent on what may be quirks of the Linux socket layer.

[originally from svn r2175]
This commit is contained in:
Simon Tatham
2002-11-01 13:36:48 +00:00
parent 6c09add500
commit fd3bc934d9
2 changed files with 12 additions and 5 deletions

View File

@ -810,10 +810,12 @@ int select_result(int fd, int event)
/*
* If we reach here, this is an oobinline socket, which
* means we should set s->oobpending and then fall through
* to the read case.
* means we should set s->oobpending and then deal with it
* when we get called for the readability event (which
* should also occur).
*/
s->oobpending = TRUE;
break;
case 1: /* readable; also acceptance */
if (s->listener) {
/*
@ -864,7 +866,7 @@ int select_result(int fd, int event)
} else
atmark = 1;
ret = recv(s->s, buf, sizeof(buf), 0);
ret = recv(s->s, buf, s->oobpending ? 1 : sizeof(buf), 0);
noise_ultralight(ret);
if (ret < 0) {
if (errno == EWOULDBLOCK) {