• exec/load/http.js

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu May 28 01:25:55 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/25b5c0296eab69d9c1f4141b
    Modified Files:
    exec/load/http.js
    Log Message:
    http.js: add PostStreaming() for HTTP/1.1 chunked-transfer responses

    Adds three methods to HTTPRequest:
    - SetupPostStreaming() -- like Post()'s setup but HTTP/1.1 and no
    automatic body collection
    - ReadChunkedBody(on_chunk) -- reads chunked-transfer-encoded body,
    invokes on_chunk(text) per chunk
    - PostStreaming(url, data, on_chunk, ...) -- POST + streamed read;
    returns the full accumulated body after the stream completes.

    Falls back gracefully if the server returns non-chunked Content-Length
    (single on_chunk call with the whole body).

    Needed by exec/chat_llm.js for streaming Ollama responses (SSE / chunked transfer) in the LLM-chat module. Purely additive -- existing Post() /
    Get() behavior unchanged.

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

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Sat Jun 20 14:58:46 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/764e12d1a3056f0146b08e83
    Modified Files:
    exec/load/http.js
    Log Message:
    http.js: add Download() and output_file for streaming a response body to disk

    HTTPRequest buffered the entire response body in a (SpiderMonkey 1.8.5) string, which is costly and risky for large downloads. Add an output_file property and a
    Download(url, filename) convenience method that stream the body straight to a file in bounded 16 KB chunks instead.

    Backward compatible: output_file defaults to undefined, so existing Get()/Post()
    callers are unchanged. Only a final 2xx response streams to the file -- a redirect (3xx) body is still read into this.body so Get()'s redirect-follow re-requests, and a 4xx/5xx error body stays in this.body for the caller to inspect. Also exposes body_length (bytes received) on every request.

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

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Mon Nov 23 22:45:05 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/54641a92ad271bc0a4b5675d
    Modified Files:
    exec/load/http.js
    Log Message:
    http.js: optional abort_check hook to abandon a pending request

    When an HTTPRequest has an abort_check function, each read first waits
    for data in 100 ms polls and calls abort_check between them. If it
    returns true, the connection is closed and an Error with .aborted = true
    is thrown. An interactive caller can use this to give up on a slow
    response, e.g. when the user starts typing. The overall wait is still
    bounded by recv_timeout.

    Requests without abort_check behave as before.

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

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