* owner: nobody => Noxx
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33699#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/33699#comment:4>
* owner: Noxx => noneNote
--
Ticket URL: <https://code.djangoproject.com/ticket/33699#comment:5>
* status: assigned => closed
* resolution: => wontfix
Comment:
Looking at this again, with an eye to #33738 — which is how we handle
`http.disconnect` event as they come in — it's not clear that we can
actually read the body file on demand (as nice as that might be in
theory).
The [https://asgi.readthedocs.io/en/latest/specs/www.html#request-receive-
event ASGI spec] is quite clear on the required behaviour:
* "...the body message serves ... as a trigger to actually run request
code (as you should not trigger on a connection opening alone)." (Elided
to bring out the force.)
* `more_body` (bool) – Signifies if there is additional content to come
(as part of a Request message). If `True`, the consuming application
should wait until it gets a chunk with this set to `False`. If `False`,
the request is complete and should be processed.
i.e. The application is not permitted to begin processing the request
until a `more_body: False` is received. You can't get that unless you read
the body.
On top of that, ref #33738, if you want to look for an `http.disconnect`,
however you might do that, you need to have got the body events, which
come in on the same queue, out of the way in order to do that. A handler
for a long-lived connection that wanted to check that the client hadn't
disconnected **before** processing an expensive operation on the submitted
body would be stuck.
Short of a PoC, and an unlikely change to the ASGI spec here, I think we
have to close this as wontfix.
--
Ticket URL: <https://code.djangoproject.com/ticket/33699#comment:6>