AmendHub

jcs

/

subtext

/

amendments

/

serial.c

Amendments on January 23, 2024


Amendments on November 27, 2023

serial: Nullify session on init, catch init string errors

This allows the init string to not have ATQ0, which we now do by
default so if the init string is later changed and produces an
ERROR response, we will log it.
Also nullify the serial node session on init, which will happen
after forced hangup. Otherwise we may have been keeping the
association of the serial node's session and disconnecting it
on forced hangup, even if that session was later reassigned to
another node.
jcs made amendment 565 4 months ago

Amendments on November 15, 2023

serial: Clarify comment now that rings are configurable

jcs made amendment 544 5 months ago

Amendments on November 9, 2023

*: Do config changes on the fly, restarting modules as needed

Annotate each config option with which component it needs restarted
when it changes and do those after saving from the sysop menu. This
also provides the ability to log each changed config option with its
old and new values.
jcs made amendment 531 5 months ago

Amendments on November 8, 2023

serial: Make number of rings before answering a configurable setting

Defaults to 1 as before, but can be increased to allow caller id
strings to come through the logger.
jcs made amendment 528 5 months ago

Amendments on May 4, 2023


Amendments on March 15, 2023

serial: Add error checking, session buf canaries to try to find bug

Something is overwriting things in the session and trashing ibuflen
or obuflen, so add canaries in between struct members to try to find
where they get trashed.
jcs made amendment 429 about 1 year ago

Amendments on March 8, 2023

serial: Internal obuf/ibuf aren't used

jcs made amendment 378 about 1 year ago

Amendments on February 23, 2023

sysop: Add an option in the sysop menu to hang up the modem

jcs made amendment 309 about 1 year ago

Amendments on February 5, 2023

*: Minor fixes found by cppcheck and scan-build

Mostly unused variables
jcs made amendment 300 about 1 year ago

session: Move bogus obuflen check here to cover all node types

jcs made amendment 299 about 1 year ago

Amendments on November 7, 2022

serial: Fix maximum input length calculation when reading serial data

This looks like it was copied from somewhere else since 'n' was never
getting used to affect 'len', so len could be a very large number of
outstanding bytes from the serial port (such as during a ZModem
transfer) which would then cause FSRead to write too much data to
ibuf, trashing the session object and possibly other malloc'd data.
Take the smaller of the serial port outstanding count, and the number
of bytes left in ibuf, when reading from the serial port.
Also enable printing of serial port errors since it's useful to see
overruns when the port speed is too high.
jcs made amendment 272 about 1 year ago

Amendments on October 26, 2022

serial: Add failsafe to avoid sending more than sizeof(obuf)

Some bug is causing obuflen to be more than sizeof(obuf), maybe
somewhere in the ZModem code.
jcs made amendment 266 about 1 year ago

Amendments on October 5, 2022

serial: Switch to async writes, fully reset driver between calls

Doing a synchronous write with PBWrite can cause the entire system
to block if the remote modem has sent an XOFF. Switch to an async
write and then poll for its completion, or timeout and kill the IO
if it's beyond our timeout. We busy loop during polling, but if it's
beyond 30 ticks we uthread_yield.
Also, if the remote has sent an XOFF, when we reset the modem, it
won't accept our new commands even after an ATZ and a SerReset.
Between calls, fully reset the driver by closing it and doing
OpenDriver again.
jcs made amendment 265 about 1 year ago

Amendments on October 1, 2022

logger: There will only be one, stop passing object around

This also helps at shutdown to know when we can no longer log.
jcs made amendment 261 about 1 year ago

serial: Allow bits/parity/stop to be configured, default to 8N1

jcs made amendment 259 about 1 year ago

Amendments on August 14, 2022

logger: Add buffered logging, support logging without updating window

During telnet negotiation, many lines are logged in quick succession
which means we spend a lot of time updating the log TextEdit. Just
buffer these logs and spit them out all at once upon login or
disconnection, so the user's login prompt is immediately responsive.
Rename session_log to session_logf while I'm in here, to reflect that
it's a format-string function.
jcs made amendment 245 about 1 year ago

Amendments on August 13, 2022

serial: Cope with not getting the beginning of the CONNECT line

jcs made amendment 242 about 1 year ago

Amendments on August 3, 2022

serial: Rewrite to allocate session on RING, then manually answer

If we can't allocate a session, just don't answer.
jcs made amendment 237 about 1 year ago

Amendments on July 16, 2022

serial: If session_create fails, hang up

Maybe we should not put the modem in auto-answer and require manual
ATA, but then only do that if we can establish a session first. That
way we don't waste time negotiating the modem just to hang up.
jcs made amendment 212 about 1 year ago