Bail out early if we're in P8 mode.

This avoids any possible strange behavior with calling Marinetti in P8 mode. It also ensures that I/O operations in P8 mode will give an error, but not terminate the connection: it will still be alive when we get back to GS/OS, unless the server has killed it due to inactivity (which is quite possible).
This commit is contained in:
Stephen Heumann 2017-04-16 18:25:58 -05:00
parent 93e2a5a864
commit fe2680b65a
4 changed files with 19 additions and 1 deletions

View File

@ -127,7 +127,8 @@ void pollTask(void) {
IncBusyFlag();
stateReg = ForceRomIn();
PollAllSessions();
if (OS_KIND == KIND_GSOS)
PollAllSessions();
runQRec.period = 4*60;
RestoreStateReg(stateReg);

View File

@ -10,4 +10,8 @@ extern void RestoreStateReg(Word);
void IncBusyFlag(void) inline(0, 0xE10064);
void DecBusyFlag(void) inline(0, 0xE10068);
#define OS_KIND (*(Byte*)0xE100BC)
#define KIND_P8 0x00
#define KIND_GSOS 0x01
#endif

View File

@ -61,6 +61,11 @@ LongWord DispatchASPCommand(SPCommandRec *commandRec) {
goto callOrig;
}
if (OS_KIND != KIND_GSOS) {
CompleteASPCommand(commandRec, aspNetworkErr);
goto ret;
}
for (i = 0; i < MAX_SESSIONS; i++) {
if (sessionTbl[i].dsiStatus == needsReset)
EndASPSession(&sessionTbl[i], 0);
@ -93,6 +98,11 @@ LongWord DispatchASPCommand(SPCommandRec *commandRec) {
goto callOrig;
}
if (OS_KIND != KIND_GSOS) {
CompleteASPCommand(commandRec, aspNetworkErr);
goto ret;
}
/*
* Hack to avoid hangs/crashes related to the AppleShare FST's
* asynchronous polling to check if volumes have been modified.

View File

@ -45,6 +45,9 @@ LongWord DoLookupName(NBPLookupNameRec *commandRec) {
stateReg = ForceRomIn();
if (OS_KIND != KIND_GSOS)
goto passThrough;
// Length needed for result, assuming the request is for our type/zone
count = offsetof(NBPLUNameBufferRec, entityName)
+ ((EntName*)commandRec->entityPtr)->buffer[0] + 1