- do not swallow bytes in buffer before sending an empty line (binprot.c)

- state after EaseStop changed to offline instead of notconnected
This commit is contained in:
2014-10-29 16:03:48 +01:00
parent 32e55f2176
commit ac04939284
2 changed files with 8 additions and 3 deletions

View File

@ -357,7 +357,12 @@ int BinHandler(Ascon *a) {
} while (res == 1);
p->nextFmt = str + pos;
a->wrPos = 0;
if (GetDynStringLength(a->wrBuffer) == 0) {
/* prevent to swallow "garbage" */
a->state = AsconWriteDone;
} else {
a->state = AsconWriting;
}
a->lineCount = 0;
return 1;
case AsconReadStart:

4
ease.c
View File

@ -61,7 +61,7 @@ void EaseStop(EaseBase * eab, char *reason)
snprintf(eab->msg, sizeof eab->msg, "offline (%s)", reason);
ParPrintf(eab, eLogError, "ERROR: %s", eab->msg);
}
eab->state = EASE_notconnected;
eab->state = EASE_offline;
}
/*----------------------------------------------------------------------------*/
@ -754,7 +754,7 @@ static int EaseInit(SConnection * pCon, EaseBase * eab, int argc,
<host> <port>
<host>:<port>
*/
int port=0, iRet, i;
int port, iRet, i;
rs232 *ser;
char *colon, *host;
char buf[64];