AmendHub

jcs

/

subtext

/

amendments

/

session.c

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 21, 2022

session: Stop persisting tally, prune old session logs

Prune after 21 days of logs by default, every morning. The db was
getting quite large and each new login or recent call check was
taking a long time.
We're stable now so we don't have to persist the call log tally to
disk, just keep it in memory.
jcs made amendment 255 about 1 year ago

Amendments on September 15, 2022

session: Add 'b' as a shortcut to first board, 'n' to mail->new

These letter->function assignments really need to be made dynamic
so main menu changes don't require source code changes.
jcs made amendment 251 about 1 year ago

Amendments on September 14, 2022

*: Add Message of the Day support

Track the highest MOTD id each user has seen and only show it on
login if the current one is higher than the user's highest seen.
Also, in migrations, we can't iterate through users while modifying
each one, because the order will change as we save and write a new
user in the map.
jcs made amendment 250 about 1 year ago

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

session: Don't set default terminal type, if node doesn't, prompt user

This way modem users and telnet users with weird clients that don't
negotiate TTYPE will get prompted for vt100 compatibility.
jcs made amendment 243 about 1 year ago

Amendments on August 3, 2022

session: Fix some memory leaks

jcs made amendment 235 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 19, 2022

*: Add session signoff view, remove session_output_template

All remaining uses of session_output_template can use session_printf
which still does {{B}} and {{/B}} parsing.
Change session_output_view to session_output_view_or_printf to make it
easier to print a view and fallback to a string, rather than having to
check the result of session_output_view everywhere.
jcs made amendment 218 about 1 year ago

Amendments on July 16, 2022

*: Properly handle running out of sessions

Limit sessions to the number of uthreads we can handle, and then
reserve 1 session for the console.
In telnet, allocate one extra node so we can print a message to the
client that we have no free nodes, and then disconnect. Add a view
for this to make it editable.
In console, handle getting a null session back from session_create.
jcs made amendment 211 about 1 year ago

session+chat: Remove session_bar, implement simpler bar in chat

This is only used in chat and only to print a left-aligned bar.
jcs made amendment 210 about 1 year ago

Amendments on July 15, 2022

session: Add a special case in session_flush for the console

jcs made amendment 207 about 1 year ago

Amendments on July 12, 2022

session: A few fixes and improvements

Make session_menu a bit more helpful and hide options with a null key
set, don't repeat "Invalid option" more than once
Add session_get_char for file transfers
jcs made amendment 191 about 1 year ago

Amendments on June 30, 2022

*: Hook up folders

jcs made amendment 179 about 1 year ago

Amendments on June 24, 2022

logger: Keep title updated with some call information

jcs made amendment 174 about 1 year ago

Amendments on June 23, 2022


Amendments on June 22, 2022

telnet: Add trusted proxy IP setting for web gateway, unblock IPs

When a telnet connection comes from the configured proxy IP, allow the
REMOTE_ADDR environment variable passed to be used as the connection's
IP. Also don't auto-ban connections from the proxy.
Request TSPEED and store it as the session's terminal speed, just for
showing up in 'who' output.
Automatically unban IPs after 30 minutes by tracking the ban time.
jcs made amendment 166 about 1 year ago