changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: ssh: fix spinning due to sticky intr flag on connection timeout

changeset 6816: 33a523cfc084
parent 6815: 7da46861669b
child 6817: 5b18d18ae709
author: cinap_lenrek@felloff.net
date: Fri, 12 Oct 2018 19:28:39 +0200
files: sys/src/cmd/ssh.c
description: ssh: fix spinning due to sticky intr flag on connection timeout
     1.1--- a/sys/src/cmd/ssh.c
     1.2+++ b/sys/src/cmd/ssh.c
     1.3@@ -110,8 +110,6 @@ wasintr(void)
     1.4 	char err[ERRMAX];
     1.5 	int r;
     1.6 
     1.7-	if(intr)
     1.8-		return 1;
     1.9 	memset(err, 0, sizeof(err));
    1.10 	errstr(err, sizeof(err));
    1.11 	r = strcmp(err, "interrupted") == 0;
    1.12@@ -1331,25 +1329,25 @@ Next1:	switch(recvpkt()){
    1.13 		qlock(&sl);
    1.14 		if(send.eof)
    1.15 			break;
    1.16-		if(n < 0 && wasintr()){
    1.17+		if(n < 0 && wasintr())
    1.18+			intr = 1;
    1.19+		if(intr){
    1.20 			if(!raw) break;
    1.21-			if(intr){
    1.22-				getdim();
    1.23-				sendpkt("busbuuuu", MSG_CHANNEL_REQUEST,
    1.24-					send.chan,
    1.25-					"window-change", 13,
    1.26-					0,
    1.27-					tty.cols,
    1.28-					tty.lines,
    1.29-					tty.xpixels,
    1.30-					tty.ypixels);
    1.31-				sendpkt("busbs", MSG_CHANNEL_REQUEST,
    1.32-					send.chan,
    1.33-					"signal", 6,
    1.34-					0,
    1.35-					"INT", 3);
    1.36-				intr = 0;
    1.37-			}
    1.38+			getdim();
    1.39+			sendpkt("busbuuuu", MSG_CHANNEL_REQUEST,
    1.40+				send.chan,
    1.41+				"window-change", 13,
    1.42+				0,
    1.43+				tty.cols,
    1.44+				tty.lines,
    1.45+				tty.xpixels,
    1.46+				tty.ypixels);
    1.47+			sendpkt("busbs", MSG_CHANNEL_REQUEST,
    1.48+				send.chan,
    1.49+				"signal", 6,
    1.50+				0,
    1.51+				"INT", 3);
    1.52+			intr = 0;
    1.53 			continue;
    1.54 		}
    1.55 		if(n <= 0)