AmendHub

jcs

/

subtext

/

amendments

/

telnet.c

Amendments on February 19, 2024

telnet: Static init nit

These are zeroed by default but just make it match the others
jcs made amendment 595 about 1 month ago

Amendments on February 13, 2024

logger: Add RFC3164 (BSD) syslog support

Log everything at system.notice for now
jcs made amendment 585 2 months ago

Amendments on December 2, 2023

telnet: Speed up initial IAC negotiation to avoid delay after connect

Extract output IAC escaping from telnet_output so telnet_output_iac
can call it to put data into node->obuf without actually flushing it
to the network. Since the initial IAC negotiation will have a bunch
of back and forth, this lets us queue up a bunch of outgoing data
that we can flush once.
Also avoid sending DO NEWENV unless we're talking to the trusted
proxy, since we only need that to receive REMOTE_ADDR. Otherwise
we'll waste time and packets receiving junk like the telnet user's
DISPLAY or XAUTHORITY variables.
jcs made amendment 573 4 months ago

Amendments on November 28, 2023

*: Move views out of database to flat files

Remove half-baked view editor and cache file contents in memory.
Add a sysop menu option to reload them.
When opening the database, if the command key is held down, prevent
opening the last-opened database and prompt for a different one.
jcs made amendment 566 4 months ago

Amendments on November 21, 2023

telnet: Don't lookup location of the trusted proxy, look it up later

Once we get the REMOTE_ADDR NEWENV, do the lookup then and update
the session log.
jcs made amendment 561 4 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 June 15, 2023


Amendments on May 1, 2023


Amendments on April 27, 2023


Amendments on April 26, 2023

telnet: Crank obuf size, send DO BINARY and WILL BINARY

jcs made amendment 487 11 months ago

Amendments on March 2, 2023

telnet: Handle malloc failure

jcs made amendment 348 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

Amendments on October 26, 2022

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

jcs made amendment 267 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

Amendments on September 23, 2022

telnet: Limit NAWS update logging

A user frequently making adjustments to their terminal window can
flood us with NAWS commands, we don't need to log every one of them.
jcs made amendment 257 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 11, 2022

telnet: Increase IAC SB buffer, log when it overflows

macOS telnet clients have a very long DISPLAY variable that was
reaching our limit of iac_sb, which then spilled into the login field
since we stop treating further data as IAC SB data.
jcs made amendment 240 about 1 year ago

Amendments on July 31, 2022

*: Add malloc annotations

jcs made amendment 226 about 1 year ago

Amendments on July 21, 2022

*: Use NewPtr instead of malloc, add malloc and free debugging

Instead of free(ptr), use xfree(&ptr) and after it calls
DisposePtr(ptr), it will update ptr to point at NULL to catch
use-after-frees.
When MALLOC_DEBUG is defined, each allocation is added to a
list, and removed when freed. If it's not in the list at free
time, it's a double-free. Also, instead of pointing pointers at
NULL, point them to a pre-defined block of zeroes and in the
idle loop, periodically check that this block is still zero. This
will also catch use-after-frees in a more reliable (but costly)
way.
jcs made amendment 220 about 1 year ago

Amendments on July 17, 2022

telnet: Remove local banning, just use UDP sending to trusted proxy

Since we can't reject connections from banned IPs before opening the
TCP connection and we can get the trusted proxy to block IPs with
UDP messages, just rip local banning out of here.
jcs made amendment 216 about 1 year ago