Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

eventTsmCustomHTTPSProtocol.OnBodyRefused

property OnBodyRefused: tHttpBodyRefusedEvent read fOnBodyRefused write fOnBodyRefused;
A REQUEST BODY WAS REFUSED by one of the Limits, on either wire - once per refusal, with the peer's answer already on its way:
- a Content-Length over BodyBytes, or on HTTP/2 over ConnBodyBytes: 413 before any of the body is taken in - on HTTP/1.1 followed by the close, on HTTP/2 by RST_STREAM(NO_ERROR) on that stream alone;
- on HTTP/1.1, a Content-Length the server-wide TotalBodyBytes has no room for: 503;
- on HTTP/2, a body that reaches BodyBytes, ConnBodyBytes or TotalBodyBytes as it arrives - one with no content-length, one that passes its own in the frame that reaches the limit, or one the server-wide budget has no room for now: its stream is reset with ENHANCE_YOUR_CALM, and Status is 0. aRefusal names the peer, the request, the declared size, the bound and its value - see tHttpBodyRefusal. Without a handler a refusal leaves no trace on the server, which is what makes an upload that stops part-way impossible to diagnose from a server log; a server should log it. A notification: nothing the handler does changes the answer, and an exception it raises is dropped. CONTRACT: runs on the I/O thread that read the request, with the connection's gate held. Log and return: do not block, and do not call back into the connection or the server.