ev_io_stop(event_base, &IO->recv_event);
IO->NextState = IO->ReadDone(IO);
if (IO->NextState == eDBQuery) {
- return QueueAnDBOperation(IO);
+ if (QueueAnDBOperation(IO) == eAbort)
+ return eReadFail;
+ else
+ return eReadSuccess;
}
else {
Finished = StrBufCheckBuffer(&IO->RecvBuf);
case eAbort:
//// StopClientWatchers(IO);
ShutDownCLient(IO);
+ break;
+ case eDBQuery:
+ StopClientWatchers(IO, 0);
+ QueueAnDBOperation(IO);
+ break;
default:
break;
}
+ case eDBQuery:
+ StopClientWatchers(IO, 0);
+ QueueAnDBOperation(IO);
+ break;
default:
break;
}
SetEVState(IO, eKill);
- if (Ctx->OtherOne->ShutdownAbort != NULL)
- Ctx->OtherOne->ShutdownAbort(Ctx->OtherOne);
+ if (Ctx->OtherOne->ShutdownAbort != NULL) {
+ Ctx->OtherOne->NextState = eAbort;
+ if (Ctx->OtherOne->ShutdownAbort(Ctx->OtherOne) == eDBQuery) {
+ StopClientWatchers(Ctx->OtherOne, 0);
+ QueueAnDBOperation(Ctx->OtherOne);
+ }
+ }
return eTerminateConnection;
}
case eReadMore:
case eReadPayload:
case eReadFile:
- IO->ReAttachCB = KillOtherContextNow;
+ Ctx->IO.ReAttachCB = KillOtherContextNow;
QueueAnEventContext(&Ctx->IO);
break;
case eDBQuery:
- IO->ReAttachCB = KillOtherContextNow;
+ Ctx->IO.ReAttachCB = KillOtherContextNow;
QueueAnDBOperation(&Ctx->IO);
break;
case eTerminateConnection: