|
@@ -397,6 +397,7 @@ my $maxchunk = 64;
|
|
|
my $maxahead = 256;
|
|
|
my $last_ack = 0;
|
|
|
my @pktends = ();
|
|
|
+my $last_enq = 0;
|
|
|
|
|
|
print STDERR "\nStarting packet transmit...\n";
|
|
|
|
|
@@ -412,7 +413,7 @@ while ($last_ack < $bytes) {
|
|
|
$chunk = 0 if ($chunk <= 0);
|
|
|
$chunk = $maxchunk if ($chunk > $maxchunk);
|
|
|
|
|
|
- my $d = tty_read($tty, \$ttybuf, $chunk ? 0 : 1000);
|
|
|
+ my $d = tty_read($tty, \$ttybuf, $chunk ? 0 : $maxchunk/10);
|
|
|
last if ($d eq '');
|
|
|
|
|
|
my $dc = unpack('C', $d);
|
|
@@ -441,10 +442,15 @@ while ($last_ack < $bytes) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- print STDERR "Send offset: $offset, window: $winspc, chunk: $chunk\n";
|
|
|
+ print STDERR "Send offset: $offset, last ack: $last_ack, window: $winspc, chunk: $chunk\n";
|
|
|
if (!$chunk) {
|
|
|
if ($bytes > $offset) {
|
|
|
- tty_write($tty, "\026"); # Request to resynchronize credits
|
|
|
+ my $now = time();
|
|
|
+ if ($now != $last_enq) {
|
|
|
+ tty_write($tty, "\026"); # SYN: request window resync
|
|
|
+ print STDERR "Trying to resynchronize window\n";
|
|
|
+ $last_enq = $now;
|
|
|
+ }
|
|
|
}
|
|
|
next;
|
|
|
}
|