diff --git a/nread.c b/nread.c index e0ea5f07..8d742114 100644 --- a/nread.c +++ b/nread.c @@ -1075,8 +1075,10 @@ static int CommandDataCB(int handle, void *userData) if (pPtr[i] == '\r' || pPtr[i] == '\n') { self->state = SKIPTERM; if (!testAndInvokeInterrupt(self, handle)) { - status = - CostaTop(self->pCon->pStack, GetCharArray(self->command)); + if (self->pCon->iProtocolID == 0 && CostaLocked(self->pCon->pStack)) + status = 0; + else + status = CostaTop(self->pCon->pStack, GetCharArray(self->command)); if (!status) { SCWrite(self->pCon, "ERROR: Busy", eError); } @@ -1174,8 +1176,10 @@ static int ANETTelnetProcess(int handle, void *usData) case '\r': case '\n': if (!testAndInvokeInterrupt(self, handle)) { - status = - CostaTop(self->pCon->pStack, GetCharArray(self->command)); + if (self->pCon->iProtocolID == 0 && CostaLocked(self->pCon->pStack)) + status = 0; + else + status = CostaTop(self->pCon->pStack, GetCharArray(self->command)); if (!status) { SCWrite(self->pCon, "ERROR: Busy", eError); }