From: ian Date: Sat, 25 Sep 1999 10:11:57 +0000 (+0000) Subject: Do not send ENDs. Do not send empty packets. X-Git-Tag: branchpoint-1996-06-19-retrospective-beforeuserv~4 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv-utils.git;a=commitdiff_plain;h=1d1209a4764e161ec232d2d76d7e698c15fd874c Do not send ENDs. Do not send empty packets. --- diff --git a/ipif/udptunnel b/ipif/udptunnel index 7160cca..1b5031c 100755 --- a/ipif/udptunnel +++ b/ipif/udptunnel @@ -215,7 +215,7 @@ for (;;) { quit "tunnel endpoint closed by system"; } while (($p= index($upbuf,"\300")) >= 0) { - if (!defined(send L,substr($upbuf,0,$p+1),0,$rs)) { + if ($p && !defined(send L,substr($upbuf,0,$p),0,$rs)) { warning("transmit error: $!"); } else { if (!$upyet) { @@ -233,6 +233,7 @@ for (;;) { warning("got packet from incorrect peer $rsp_from"); next; } + $downbuf= "\300".$downbuf."\300"; if (!defined($r= syswrite(DW,$downbuf,length $downbuf))) { warning("tunnel endpoint write error: $!"); } elsif ($r != length $downbuf) {