SICS-595: Added "busy" checks to the callbacks used by asynnet.c:anetRead()

This commit is contained in:
Ferdi Franceschini
2013-04-27 18:00:36 +10:00
parent c6f1dd6591
commit 44579ee8aa

12
nread.c
View File

@ -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);
}