TsgcHTTP3Client › Methods › CancelPush

CancelPush Method

Sends a CANCEL_PUSH frame that refuses a server push identified by its push ID.

Syntax

procedure CancelPush(aPushId: Int64);

Parameters

NameTypeDescription
aPushIdInt64Push ID to refuse, as reported by OnPushPromise.

Return Value

None.

Remarks

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.

Example



procedure OnPushPromiseEvent(Sender: TObject; aPushId: Int64;

  const aHeaders: TStringList);

begin

  // refuse every promised push

  oClient.CancelPush(aPushId);

end;

Back to Methods