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') {
|
if (pPtr[i] == '\r' || pPtr[i] == '\n') {
|
||||||
self->state = SKIPTERM;
|
self->state = SKIPTERM;
|
||||||
if (!testAndInvokeInterrupt(self, handle)) {
|
if (!testAndInvokeInterrupt(self, handle)) {
|
||||||
status =
|
if (self->pCon->iProtocolID == 0 && CostaLocked(self->pCon->pStack))
|
||||||
CostaTop(self->pCon->pStack, GetCharArray(self->command));
|
status = 0;
|
||||||
|
else
|
||||||
|
status = CostaTop(self->pCon->pStack, GetCharArray(self->command));
|
||||||
if (!status) {
|
if (!status) {
|
||||||
SCWrite(self->pCon, "ERROR: Busy", eError);
|
SCWrite(self->pCon, "ERROR: Busy", eError);
|
||||||
}
|
}
|
||||||
@ -1174,8 +1176,10 @@ static int ANETTelnetProcess(int handle, void *usData)
|
|||||||
case '\r':
|
case '\r':
|
||||||
case '\n':
|
case '\n':
|
||||||
if (!testAndInvokeInterrupt(self, handle)) {
|
if (!testAndInvokeInterrupt(self, handle)) {
|
||||||
status =
|
if (self->pCon->iProtocolID == 0 && CostaLocked(self->pCon->pStack))
|
||||||
CostaTop(self->pCon->pStack, GetCharArray(self->command));
|
status = 0;
|
||||||
|
else
|
||||||
|
status = CostaTop(self->pCon->pStack, GetCharArray(self->command));
|
||||||
if (!status) {
|
if (!status) {
|
||||||
SCWrite(self->pCon, "ERROR: Busy", eError);
|
SCWrite(self->pCon, "ERROR: Busy", eError);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user