• src/syncterm/term.c

    From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 10:21:00
    https://gitlab.synchro.net/main/sbbs/-/commit/a830fb8ca21c9811015f58c3
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Initial implementation of CET Telesoftware downloads

    This sucks, but mostly kinda works.
    For nelgin.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 10:21:00
    https://gitlab.synchro.net/main/sbbs/-/commit/56ebcee9e6d3a10365a72a55
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix Telesoftware downloads from Glass TTY

    Sending the square before the frame finishes being received ends up
    not working "sometimes", which breaks downloads from Glass TTY.

    The original protocol spec says to wait until two seconds have passed
    since the last character to detect an end of frame before requesting
    the next one... this change does that wait.

    There may be a better way to detect end of frame, but I can't come
    up with one off-hand.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 10:21:00
    https://gitlab.synchro.net/main/sbbs/-/commit/816758b11f3a3f782bad75f6
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix Coverity issues found in CET Telesoftware downloads

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 10:21:00
    https://gitlab.synchro.net/main/sbbs/-/commit/557776f155e5baed4e7ea906
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Add transfer status and abort capability

    The transfer window is still 66 characters wide though.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 13:25:00
    https://gitlab.synchro.net/main/sbbs/-/commit/eb1fd0eeb6db4dd0c2306323
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Overhaul transfer windows to fit on smaller screens

    There's still a need to switch to/from CP437 for the borders.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 13:28:00
    https://gitlab.synchro.net/main/sbbs/-/commit/1852499ee225a25cd86fb824
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Remove debug output from last commit

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 13:45:00
    https://gitlab.synchro.net/main/sbbs/-/commit/a04557a7a65267fac1cf6bf2
    Modified Files:
    src/syncterm/term.c
    Log Message:
    MSVC doesn't support VLAs, so just make these biffer than needed

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 13:50:00
    https://gitlab.synchro.net/main/sbbs/-/commit/0e62ea63a371a7bd1f5a3742
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Oh yeah, if you don't use VLAs, the L of the A won't be C.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 17:46:00
    https://gitlab.synchro.net/main/sbbs/-/commit/4a80117da0fa6e0364a1794c
    Modified Files:
    src/syncterm/term.c
    Log Message:
    First overhaul of CET Telesoftware

    Add a state struct, don't re-request initial frame (doesn't work on
    NXtel). Should likely update every second instead of every frame
    as long as there's a two-second delay between frames. :(

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 22:49:00
    https://gitlab.synchro.net/main/sbbs/-/commit/7a6462642013daf861267fdd
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Reduce frame timeout to 100ms

    Telestar 2.0 (used by Glass TTY and others) has a requirement for
    100ms between characters, which is why the original streaming mode
    didn't work. Reducing the inter-frame delay from two seconds to
    100 ms potentially makes downloads up to twenty times faster.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 22:54:00
    https://gitlab.synchro.net/main/sbbs/-/commit/3fca9edb01546d26db4026f1
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Default HASH_GUARD_TIME is actually 200ms :(

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 19, 2025 23:47:00
    https://gitlab.synchro.net/main/sbbs/-/commit/1666b1204a0784fed805edd8
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Detect Telstar-2 systems and only slow down downloads there

    For all other Prestel systems, us a minimal (1ms) delay betwen
    frames.

    No need to punish all Prestel systems just because Telstar sometimes
    tosses out a # that arrives "too soon"

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Saturday, September 20, 2025 00:32:00
    https://gitlab.synchro.net/main/sbbs/-/commit/0b560fa7f7c43e9b0e800bea
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fixes for massive 11,550 frame download from CCL4

    Do not log an error when "unknown size" downloads complete.
    Don't list remaining time for files of unknown size.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Saturday, September 20, 2025 11:58:00
    https://gitlab.synchro.net/main/sbbs/-/commit/876a22f827eb14f83eecbf43
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix up some comments, remove debug output

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, September 21, 2025 12:35:00
    https://gitlab.synchro.net/main/sbbs/-/commit/507e1cadff08c79c1ee313b4
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Handle retransmitted old frames better

    We can recover from this by moving to the next frame/page... only
    unrecoverable if a frame is skipped.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, September 21, 2025 14:18:00
    https://gitlab.synchro.net/main/sbbs/-/commit/af33f8be0b64c89a41c62aff
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Request the server to resend the last frame at end of download

    This is the expected behaviour apparently.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Monday, September 22, 2025 10:24:00
    https://gitlab.synchro.net/main/sbbs/-/commit/9f5815e1fe38eaefff90df59
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix some free-before-use errors

    Reported by nelgin

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Monday, September 22, 2025 20:38:00
    https://gitlab.synchro.net/main/sbbs/-/commit/b5dd8353c73260d7f2737fe9
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Avoid the need for *00 at end of CET Telesoftware download

    Just buffer everything from the last clear-screen to the end of
    the transfer, then display it after the download.

    While we're here, clean up the error handling a bit, and complicate begin_download() to offset that.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Wednesday, September 24, 2025 08:31:00
    https://gitlab.synchro.net/main/sbbs/-/commit/148287b048d2425c44980160
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix a couple double-free issues

    With the cleanup code added, any free()s need to be set to NULL...
    But there's no reason to call free in the first place anymore.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Wednesday, September 24, 2025 08:47:00
    https://gitlab.synchro.net/main/sbbs/-/commit/8bdf5018a802f31d838ecc36
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix two issues

    When the terminal was 40 columns wide, the status bar update wrote
    out of bounds of the allocation. Fixed two ways.

    Remaining blocks in CET Telesoftware downloads were not properly
    updated for retries.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Thursday, September 25, 2025 23:59:00
    https://gitlab.synchro.net/main/sbbs/-/commit/b5052ce242827c2c19e1bf48
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Remove telstar detection and slowing down

    All Glass TTY nodes have been updated to fix the issue now.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 26, 2025 00:08:00
    https://gitlab.synchro.net/main/sbbs/-/commit/f1fcd09eb056e38bbf8991db
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Whoops, we need limits.h for DBL_MIN

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, September 26, 2025 00:11:00
    https://gitlab.synchro.net/main/sbbs/-/commit/1b33f1ebf9082148a197cd9b
    Modified Files:
    src/syncterm/term.c
    Log Message:
    DBL_MIN is in float.h, not limits.h

    Harumph.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Saturday, September 27, 2025 20:08:00
    https://gitlab.synchro.net/main/sbbs/-/commit/8dee93ee8ead84c83c971e56
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Use enum values for mouse mode.

    Also, in RIP mode, scroll wheel up enters scrollback, it doesn't
    send XTerm mouse commands to the remote. :D

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, October 24, 2025 20:16:00
    https://gitlab.synchro.net/main/sbbs/-/commit/b9cfc7e81c0d260458d6f89c
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix download window corruption

    Probobly introduced by eb1fd0eeb6d, the progress window would scroll
    when the progress bar was displayed.

    Two changes here... save/restore the window and cursor position
    in the _progress() functions, and disable window scrolling when
    updating the progress window.

    The first is just good hygene, the second is the actual fix.

    Should fix ticket 210

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS@VERT to Git commit to main/sbbs/m on Sunday, November 30, 2025 15:19:00
    https://gitlab.synchro.net/main/sbbs/-/commit/a05fec3af8ef4c76dbbaddde
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Use GNU printf attribuite to detect (and fix) several printf-formatting bugs

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS@VERT to Git commit to main/sbbs/m on Sunday, November 30, 2025 15:19:00
    https://gitlab.synchro.net/main/sbbs/-/commit/62e58702ea70431b411b170b
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Display a sensible error message if the X/YMODEM receive file is a directory

    Previously, it'd just display "Error 21 creating path/<filename>"

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on ChromeOS@VERT to Git commit to main/sbbs/m on Sunday, November 30, 2025 15:19:00
    https://gitlab.synchro.net/main/sbbs/-/commit/453cf4861513ea2b2b85fdaa
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Eliminate double-slash in download file path if download dir ends in slash

    If the user-specified download path ends in a slash, we'd create a download path for x/ymodem-downloaded files with a double-slash. Fix that.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Friday, December 05, 2025 21:21:00
    https://gitlab.synchro.net/main/sbbs/-/commit/76b61fd28481eb60d6d7db89
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Use snprintf() appropriately when copying dldir

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Monday, December 15, 2025 17:20:00
    https://gitlab.synchro.net/main/sbbs/-/commit/61b94cdff4db351ae0d5805a
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix warning for xmodem printf for status line

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, March 15, 2026 01:06:00
    https://gitlab.synchro.net/main/sbbs/-/commit/d5e37e7999b5adf959d31e60
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix buffer overflows and missing NULL checks in term.c

    apc_handler(): two strcat(fn, p) calls append data from APC escape
    sequences (received from the remote BBS) into fn[MAX_PATH+1] without
    length checks. Changed to strlcat(fn, p, sizeof(fn)).

    mousedrag(): sbufsize was declared int but holds
    width * sizeof(vmem_cell) * height, which is assigned to malloc().
    On very large terminal dimensions the int multiplication can wrap,
    causing an undersized allocation. Changed sbufsize to size_t with
    an explicit (size_t) cast on the first operand. Also added a NULL
    check on the three malloc() calls Ä previously a failed allocation
    would be passed straight to vmem_gettext()/gettext() and crash.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, March 15, 2026 01:06:00
    https://gitlab.synchro.net/main/sbbs/-/commit/95e02a29689ac912ba72c058
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix NULL deref, buffer overflow, and over-allocation in term.c

    NULL deref in cet_telesoftware_try_get_block() (line 1269): malloc()
    result dereferenced without NULL check. The caller already handles a
    NULL return via retry loop.

    strncat overflow in apc_handler() (line 4352): The SyncTERM:C;S APC
    handler appended a network-controlled filename to fn[MAX_PATH+1]
    using strncat, whose third argument limits source bytes, not
    destination space. A malicious server sending a long filename in the
    APC sequence overflows the stack buffer. Replace with strlcat bounded
    by sizeof(fn).

    b64_decode_alloc() over-allocation (line 3538): Operator precedence
    bug: "slen * 3 + 3 / 4 + 1" computes slen*3+0+1 (since 3/4 is 0 in
    integer division) instead of the intended base64 size. This wastes 4x
    memory on 64-bit and can wrap size_t on 32-bit. Fix to the standard
    formula (slen+3)/4*3+1.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, March 15, 2026 14:09:00
    https://gitlab.synchro.net/main/sbbs/-/commit/7b847a23bef419ee2ec96e6f
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix multiple bugs in term.c

    - CET telesoftware: invert success flag (was "success = st.aborted",
    now "success = !st.aborted").
    - CET telesoftware: when frame count exhausts without end-of-file
    marker, set frames_remaining to 999 (unknown) and continue rather
    than silently underflowing on next decrement.
    - CET block allocation: add +1 byte for NUL terminator to prevent
    off-by-one write past flexible array member.
    - get_cache_fn_base/get_cache_fn_subdir: add bounds checks before
    strcat to prevent buffer overflow with long BBS names or subdirs.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Sunday, March 15, 2026 19:01:00
    https://gitlab.synchro.net/main/sbbs/-/commit/fe6b7aceafcd4768736620c7
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Fix truncated conn_send() lengths for keyboard escape sequences

    43 conn_send() calls were passing incorrect buffer lengths, causing
    truncated escape sequences to be sent to the remote host:

    - Delete key (non-DECBKM): sent 1 byte of "\x1b[3~" instead of 4
    - F1-F5: sent 3 bytes of 5-byte sequences (e.g. "\033[11~")
    - Shift+F1-F5, Ctrl+F1-F5, Alt+F1-F5: sent 3 bytes of 7-byte
    sequences (e.g. "\033[11;2~")
    - Shift+F6-F12, Ctrl+F6-F12, Alt+F6-F12: sent 5 bytes of 7-byte
    sequences (e.g. "\033[17;2~")

    The lengths appear to have been copy-pasted from the 3-byte arrow key
    sequences without being updated for the longer function key strings.

    Unmodified F6-F12 (5-byte) and arrow/nav keys (3-byte) were already
    correct.

    Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Deuc¿@VERT to Git commit to main/sbbs/m on Monday, March 16, 2026 21:53:00
    https://gitlab.synchro.net/main/sbbs/-/commit/352aeaaf9bf5499ef4c558e0
    Modified Files:
    src/syncterm/term.c
    Log Message:
    Skip hyperlink hover tracking when status bar is disabled

    Prevents stale hover_hyperlink_id state and avoids blocking
    update_status() when there is no status bar to update.

    Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net