Commit Graph

17 Commits

Author SHA1 Message Date
Stephen Heumann fe2680b65a 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).
2017-04-16 18:25:58 -05:00
Stephen Heumann 93e2a5a864 Call attention routine when appropriate, and handle close requests from the server. 2017-04-16 16:19:59 -05:00
Stephen Heumann 5b5295fd40 Fixes related to error handling and asynchronous command support. 2017-04-16 15:17:55 -05:00
Stephen Heumann 9d6dad03b4 Add support for soft reset.
This can occur when control-reset is pressed in P8 mode. It’s supposed to reinitialize the AppleTalk stack. In our case, we mark connections to be reset once we're back in GS/OS, since we can't call Marinetti in P8 mode.
2017-04-16 13:36:01 -05:00
Stephen Heumann 7d2c225d2f Add code to close the sessions when the system is shutting down.
This only works if our init is loaded before Marinetti’s, because otherwise Marinetti’s shutdown notification procedure gets control first and shuts down the connection.
2017-04-16 00:37:57 -05:00
Stephen Heumann a52a041389 Add support for rewriting login requests to force use of AFP version 2.2.
This should add support for a greater variety of servers, which may only support AFP 2.2 and up (or refuse to use older versions over TCP).

The IIgs software is designed for AFP 2.0. AFP 2.2 is close enough that things seem to work, but there could potentially be a few compatibility issues.
2017-04-15 18:11:24 -05:00
Stephen Heumann d4857e483f Implement option to let read replies return more data than the specified reply buffer size.
This could be unsafe for some forms of client code, but it looks like the AppleShare FST always actually has a large enough buffer to hold the full amount being requested, and can deal with up to 65535 bytes being returned at once. We take advantage of this to do larger reads in a single request, which provides a noticeable performance advantage.
2017-04-15 00:06:43 -05:00
Stephen Heumann 3b2f1b6a25 Pass through calls we don’t handle to the original AppleTalk stack.
It is now possible to have AFP volumes mounted over both AppleTalk and TCP/IP simultaneously.
2017-04-09 20:57:09 -05:00
Stephen Heumann c119492cec 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.
2017-04-03 20:19:30 -05:00
Stephen Heumann 3f40a3190d Modify FPRead requests so they don’t return more data than will fit in the reply buffer.
This issue arises because ASP requests and replies are limited to a “quantum size” of 4624 bytes even if the amount requested is larger, and the AppleShare FST relies on this behavior in sizing its buffers. DSI does not have this limitation, so it was returning more data than would fit in the buffer.

Also improve error checking, so an error is reported in cases where the buffer is too small.
2017-04-03 16:36:50 -05:00
Stephen Heumann 17421e0ba5 Add support for calling asynchronous completion routines.
At this point it can connect and largely work, but there are still several issues.
2017-04-03 15:39:37 -05:00
Stephen Heumann 9720f37531 Initial code for installing our commands.
This code works to some extent, but tends to cause system hangs.

Also includes some DSI implementation fixes.
2017-04-01 15:32:32 -05:00
Stephen Heumann ee83e402f8 Implement support for DSIWrite, plus a few other cleanups. 2017-03-23 02:31:06 -05:00
Stephen Heumann 275f3456ba Add support for sending DSICommand requests. 2017-03-22 20:13:20 -05:00
Stephen Heumann 83c702fcbb Include the FPGetSrvrInfo AFP-level request in DSIGetInfo packets.
The macOS AFP server gives a response even without this, but the protocol spec says it should be there.
2017-03-20 00:58:17 -05:00
Stephen Heumann 0b0a422c33 Updates to support opening and closing a session. 2017-03-19 17:23:42 -05:00
Stephen Heumann b5c3a29f37 Initial version, with test program.
It can currently send a GetStatus request and get a response.
2017-03-18 19:42:25 -05:00