This commit is contained in:
cinap_lenrek 2016-03-10 19:03:28 +01:00
commit 3e52ada202

View file

@ -178,7 +178,7 @@ Restart:
failed = 0;
lostsync = 0;
while (!done) {
if (failed) {
if (netfd < 0 || failed) {
// Wait for the netreader to die.
while (netfd >= 0) {
dmessage(1, "main; waiting for netreader to die\n");
@ -208,7 +208,7 @@ Restart:
}
if(++lostsync > 2){
dmessage(2, "main; lost sync\n");
syslog(0, Logname, "connection seems hung up...");
failed = 1;
continue;
}
@ -218,6 +218,9 @@ Restart:
case Unsent:
sendp(unacked, b);
if (netfd < 0)
break;
PBIT32(b->hdr.acked, inmsg);
if (writen(netfd, (uchar *)&b->hdr, Hdrsz) < 0) {