Chapters:
The tracker hang spot:
return render_template("upload.html", group=group, files=names)
Right now Flask builds the whole upload.html and only then flushes. On a tiny 2005 firewall that delay is enough to make the browser think the connection is toast.
🔧 Minimal adjustment (test mode)
Yes, you can “tack on” Response to your existing imports. You already have:
from flask import request, redirect, jsonify, render_template, \
send_from_directory, abort, send_file, make_response
👉 Add Response to the list:
from flask import request, redirect, jsonify, render_template, \
send_from_directory, abort, send_file, make_response, ResponseThen change your return line to stream:
return Response(
render_template("upload.html", group=group, files=names),
mimetype="text/html")🔍 Why this helps
- Old way: browser waits until template fully rendered before anything comes back.
-
New way: Flask hands the rendered template to
Response, which can start flushing headers/body right away. - That tiny difference is often enough to keep old gear happy → browser stops spinning.
⏱ How to test
- Make that one-line change.
-
Restart TD (
systemctl restart transferdepotor however you run it). -
Upload a small file in the browser.
- If the spinner finally closes → bingo, response path fixed.
-
If not, we’ll escalate to
stream_with_context(chunked streaming), but this quickResponsewrapper is the safe first step.