From c119492cec3f10bb9ebca462eb868449ef79d37c Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Mon, 3 Apr 2017 20:19:30 -0500 Subject: [PATCH] Work around problem with asynchronous polling calls from AppleShare FST. This patch disables asynchronous SPCommand calls to work around the problem, which was causing hangs and crashes when those calls triggered. This effectively prevents the FST from automatically polling to check if the volume has been changed, but shouldn't cause other problems. --- aspinterface.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aspinterface.c b/aspinterface.c index b52b03d..8d4c02d 100644 --- a/aspinterface.c +++ b/aspinterface.c @@ -68,6 +68,23 @@ void DispatchASPCommand(SPCommandRec *commandRec) { commandRec->result = atInvalidCmdErr; goto ret; } + + /* + * Hack to avoid hangs/crashes related to the AppleShare FST's + * asynchronous polling to check if volumes have been modified. + * This effectively disables that mechanism (which is the only + * real user of asynchronous ASP calls). + * + * TODO Identify and fix the underlying issue. + */ + if ((commandRec->async & AT_ASYNC) + && commandRec->command == aspCommandCommand) + { + commandRec->result = atSyncErr; + CallCompletionRoutine((void*)commandRec->completionPtr); + goto ret; + } + i = commandRec->refNum - SESSION_NUM_START; sess = &sessionTbl[i]; sess->spCommandRec = commandRec;