From c52beb2f1785d243ab67193192c45bf74973f6c0 Mon Sep 17 00:00:00 2001 From: Nidhi Jaju Date: Tue, 25 Apr 2023 09:34:36 +0000 Subject: [PATCH] queue task to cleanup transport --- index.bs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 896f903e..6fbc9e2e 100644 --- a/index.bs +++ b/index.bs @@ -1097,8 +1097,13 @@ This specification defines [=unloading document cleanup steps=] as the following 1. Let |window| be |document|'s [=relevant global object=]. 1. For each {{WebTransport}} |transport| whose [=relevant global object=] is |window|: - 1. If |transport|.{{[[State]]}} is `"connected"`, set |transport|.{{[[State]]}} to `"failed"` - and [=session/terminate=] |transport|.{{[[Session]]}} [=in parallel=]. + 1. If |transport|.{{[[State]]}} is `"connected"`, then: + 1. Set |transport|.{{[[State]]}} to `"failed"`. + 1. [=In parallel=], [=session/terminate=] |transport|.{{[[Session]]}}. + 1. [=Queue a network task=] with |transport| to run the following steps: + 1. Let |error| be a newly [=DOMException/created=] {{WebTransportError}} whose + {{WebTransportErrorOptions/source}} is `"session"`. + 1. [=Cleanup=] |transport| with |error|. 1. If |transport|.{{[[State]]}} is `"connecting"`, set |transport|.{{[[State]]}} to `"failed"`.