Commit Graph

13 Commits

Author SHA1 Message Date
Stephen Heumann 527483b03b Return specific values from main() in the various programs.
Previously, there were bare "return;" statements in some places, even though main() was declared as returning int. This is disallowed by C99 and later, and ORCA/C now complains about it when using full lint checks.
2020-02-06 17:28:55 -06:00
Stephen Heumann 814158ab0e Reinstall our attention vector patch on return from P8.
It was getting uninstalled when the ATalk driver was restarted at that time.
2017-04-25 22:15:12 -05:00
Stephen Heumann 9ea3f1d2fb Don't call the ATalk driver's attention vector routine for DSI connections.
It is hard-coded to work with session numbers 1-8, and it may trash memory when passed higher session numbers. This was causing crashes after disconnecting in some cases.

This patch just bypasses the attention vector routine completely for DSI sessions (it's still called for sessions 1-8, i.e. ASP sessions). This should be OK, because its only real function was to display alerts about the connection being closed.
2017-04-25 18:30:39 -05:00
Stephen Heumann a38e2f716a Detect when Marinetti has disconnected, and close all sessions at that time.
Also, detect and give an error when invalid session numbers are used.
2017-04-24 17:47:16 -05:00
Stephen Heumann 6be698833d Detect if AFPBridge and Marinetti are installed, and give an error/warning if not.
We indicate that AFPBridge is installed by creating a message in the message center (which also includes its version, in case we want to distinguish between different versions in the future).
2017-04-19 21:10:23 -05:00
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 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 e5c1cd4465 Allow AFPBridge init to work when loaded before the TCPIP init.
In that case, LoadOneTool returns an error, but the tool stub is still loaded, which is good enough (we just need its FPT to be loaded and installed in the TPT).
2017-04-15 23:01:48 -05:00
Stephen Heumann 35bcc701d3 Check for presence of AppleShare FST and don't load if it is missing.
We also don't load if the Marinetti tool stub is missing (we can't easily check for the Marinetti init).
2017-04-09 22:06:13 -05:00
Stephen Heumann 503b15b5e4 Make afpbridge an init.
This currently uses the run queue to poll for messages from the server, which works OK in typical desktop programs but not in other environments.
2017-04-05 00:24:54 -05:00
Stephen Heumann 1f6122ba39 Correctly detect when Marinetti needs to be loaded. 2017-04-03 23:33:00 -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