Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodiHttpExchange.DiscardBody

procedure DiscardBody;
Drops the part of the response body you have not read and gives its receive-window credit back - for every response whose body you do not want, a 404 page for example. On a completed response Read then reports the end of the body (0) and ReadAll an empty one; status, headers and trailers stay readable, and the client lets go of the exchange. On a response not yet complete it cancels first, as Cancel does, and drops what had arrived, so Read reports cHttpReadFailed. On a completed response it leaves an upload still being written alone; Cancel ends that. Safe from any thread; calling it again does nothing.