TsgcHTTP3Client › Methods › CancelPush
Sends a CANCEL_PUSH frame that refuses a server push identified by its push ID.
procedure CancelPush(aPushId: Int64);
| Name | Type | Description |
|---|---|---|
aPushId | Int64 | Push ID to refuse, as reported by OnPushPromise. |
None.
CancelPush sends a CANCEL_PUSH frame on the client control stream, as defined in RFC 9114 Section 7.2.3. It tells the server that the client is not interested in a push it promised, so the server can stop sending it or never start.
The typical flow is to inspect the promised request headers on OnPushPromise, decide the resource is already cached or not wanted, and call CancelPush with that push ID. A push that is not cancelled is delivered on OnPush.
The call does nothing when the control stream is not open yet, which means the client must be connected before cancelling a push.
procedure OnPushPromiseEvent(Sender: TObject; aPushId: Int64;
const aHeaders: TStringList);
begin
// refuse every promised push
oClient.CancelPush(aPushId);
end;