@fails-components/webtransport-transport-http3-quiche 1.6.4 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../lib/socket.js"],"names":[],"mappings":"AA4FA;IACE;;OAEG;IAEH,kBAHW,OAAO,4BAA4B,EAAE,oBAAoB,GAAC,SAAS,EAc7E;IAVC,0CAA0C;IAE1C,WAFW,OAAO,YAAY,EAAE,MAAM,CAEZ;IAE1B,UAAqB;IACrB,oBAAuB;IA+BzB,qBAQC;IAhCD,+BAGC;IAPC,iBAAoB;IACpB,gBAAmB;IAQrB;;OAEG;IAEH,mDAHW,OAAO,SAAS,EAAE,mBAAmB,WAgB/C;CAWF"}
1
+ {"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../lib/socket.js"],"names":[],"mappings":"AA4FA;IACE;;OAEG;IAEH,kBAHW,OAAO,4BAA4B,EAAE,oBAAoB,GAAC,SAAS,EAc7E;IAVC,0CAA0C;IAE1C,WAFW,OAAO,YAAY,EAAE,MAAM,CAEZ;IAE1B,UAAqB;IACrB,oBAAuB;IA+BzB,qBASC;IAjCD,+BAGC;IAPC,iBAAoB;IACpB,gBAAmB;IAQrB;;OAEG;IAEH,mDAHW,OAAO,SAAS,EAAE,mBAAmB,WAgB/C;CAYF"}
package/lib/socket.js CHANGED
@@ -138,6 +138,7 @@ export class Http3WebTransportSocket {
138
138
  this.socketInt.getSendQueueCount() === 0 &&
139
139
  this.blocked
140
140
  ) {
141
+ this.blocked = false
141
142
  this.cobj.onCanWrite()
142
143
  }
143
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fails-components/webtransport-transport-http3-quiche",
3
- "version": "1.6.4",
3
+ "version": "1.6.6",
4
4
  "description": "A component to add webtransport support (server and client) to node.js, transport using libquiche",
5
5
  "exports": {
6
6
  ".": {
@@ -59,6 +59,16 @@ namespace quic
59
59
  on_interim_headers_ = std::move(on_interim_headers);
60
60
  }
61
61
 
62
+ void OnWebTransportRejected(QuicStreamId id) {
63
+ // ok now find the visitor, and then we can signal, that it is closed
64
+ auto it = svisitors_.find(id);
65
+
66
+ if (it != svisitors_.end()) {
67
+ Http3WTSession::Visitor* visitor = it->second;
68
+ visitor->OnSessionClosed(255, "Webtransport connection rejected");
69
+ }
70
+ }
71
+
62
72
  private:
63
73
  std::function<void(const quiche::HttpHeaderBlock &)> on_interim_headers_;
64
74
  const bool drop_response_body_;
@@ -9,7 +9,10 @@
9
9
  // found in the LICENSE file.
10
10
 
11
11
  #include "src/http3clientstream.h"
12
+ #include "src/http3clientsession.h"
12
13
  #include "quiche/common/platform/api/quiche_logging.h"
14
+ #include "quiche/web_transport/web_transport_headers.h"
15
+ #include "quiche/quic/core/http/web_transport_http3.h"
13
16
 
14
17
  namespace quic {
15
18
 
@@ -49,4 +52,15 @@ bool Http3ClientStream::ParseAndValidateStatusCode() {
49
52
  return true;
50
53
  }
51
54
 
55
+ void Http3ClientStream::OnInitialHeadersComplete(
56
+ bool fin, size_t frame_len, const QuicHeaderList& header_list) {
57
+ QuicSpdyClientStream::OnInitialHeadersComplete(fin, frame_len, header_list);
58
+ if (web_transport() != nullptr) {
59
+ if (!web_transport()->ready()) {
60
+ printf("Oninitial headers close\n");
61
+ static_cast<Http3ClientSession*>(spdy_session())->OnWebTransportRejected(id());
62
+ }
63
+ }
64
+ }
65
+
52
66
  } // namespace quic
@@ -28,6 +28,10 @@ class Http3ClientStream : public QuicSpdyClientStream {
28
28
  on_interim_headers_ = std::move(on_interim_headers);
29
29
  }
30
30
 
31
+ // Override to signal the new webtransport session
32
+ void OnInitialHeadersComplete(bool fin, size_t frame_len,
33
+ const QuicHeaderList& header_list) override;
34
+
31
35
  protected:
32
36
  bool ParseAndValidateStatusCode() override;
33
37
 
@@ -39,7 +39,8 @@ namespace quic
39
39
  else
40
40
  {
41
41
  // Blocked
42
- return WriteResult(WRITE_STATUS_BLOCKED, 0);
42
+ writeBlocked_ = true;
43
+ return WriteResult(WRITE_STATUS_BLOCKED_DATA_BUFFERED, 0); // we actually buffer the data
43
44
  }
44
45
  }
45
46