SICS-595: Added "busy" checks to the callbacks used by asynnet.c:anetRead()
This commit is contained in:
12
nread.c
12
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user