• exec/load/http.js

    From Rob Swindell (on Debian Linux)@1:103/705 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>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)