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.
git-svn-id: svn://svn.tartarus.org/sgt/putty@2175
cda61777-01e9-0310-a592-
d414129be87e
/*
* If we reach here, this is an oobinline socket, which
/*
* 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).
case 1: /* readable; also acceptance */
if (s->listener) {
/*
case 1: /* readable; also acceptance */
if (s->listener) {
/*
- 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) {
noise_ultralight(ret);
if (ret < 0) {
if (errno == EWOULDBLOCK) {
for (i = 0; i < skcount; i++) {
socket = sklist[i];
for (i = 0; i < skcount; i++) {
socket = sklist[i];
+ /*
+ * We must process exceptional notifications before
+ * ordinary readability ones, or we may go straight
+ * past the urgent marker.
+ */
+ if (FD_ISSET(socket, &xset))
+ select_result(socket, 4);
if (FD_ISSET(socket, &rset))
select_result(socket, 1);
if (FD_ISSET(socket, &wset))
select_result(socket, 2);
if (FD_ISSET(socket, &rset))
select_result(socket, 1);
if (FD_ISSET(socket, &wset))
select_result(socket, 2);
- if (FD_ISSET(socket, &xset))
- select_result(socket, 4);
}
if (FD_ISSET(0, &rset)) {
}
if (FD_ISSET(0, &rset)) {