@@ -27,25 +27,6 @@ namespace node::quic {
2727
2828class Endpoint ;
2929
30- // A block of pending outbound stream data, passed between the application
31- // layer (which fills it via GetStreamData) and the send pump (which hands
32- // it to ngtcp2_conn_writev_stream and commits the accepted length).
33- struct StreamData final {
34- // The actual number of vectors in the struct, up to kMaxVectorCount.
35- size_t count = 0 ;
36- // The stream identifier. If this is a negative value then no stream is
37- // identified.
38- stream_id id = -1 ;
39- int fin = 0 ;
40- ngtcp2_vec data[kMaxVectorCount ]{};
41- BaseObjectPtr<Stream> stream;
42-
43- inline operator const ngtcp2_vec*() const { return data; }
44- inline operator ngtcp2_vec*() { return data; }
45-
46- std::string ToString () const ;
47- };
48-
4930// A Session represents one half of a persistent connection between two QUIC
5031// peers. Every Session is established first by performing a TLS handshake in
5132// which the client sends an initial packet to the server containing a TLS
@@ -123,6 +104,25 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
123104 // of a QUIC Session.
124105 class Application ;
125106
107+ // A block of pending outbound stream data, passed between the application
108+ // layer (which fills it via GetStreamData) and the send pump (which hands
109+ // it to ngtcp2_conn_writev_stream and commits the accepted length).
110+ struct StreamData final {
111+ // The actual number of vectors in the struct, up to kMaxVectorCount.
112+ size_t count = 0 ;
113+ // The stream identifier. If this is a negative value then no stream is
114+ // identified.
115+ stream_id id = -1 ;
116+ int fin = 0 ;
117+ ngtcp2_vec data[kMaxVectorCount ]{};
118+ BaseObjectPtr<Stream> stream;
119+
120+ inline operator const ngtcp2_vec*() const { return data; }
121+ inline operator ngtcp2_vec*() { return data; }
122+
123+ std::string ToString () const ;
124+ };
125+
126126 // Decode the first ALPN protocol name from wire format (length-prefixed).
127127 static std::string_view DecodeAlpn (std::string_view wire);
128128
@@ -446,8 +446,8 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
446446 Packet::Ptr CreateStreamDataPacket ();
447447
448448 // Tries to pack a pending datagram into the current packet buffer.
449- // If < 0 is returned, either NGTCP2_ERR_WRITE_MORE or a fatal error is
450- // returned ; the caller must check. If > 0 is returned, the packet is done
449+ // If a negative value is returned, it is either NGTCP2_ERR_WRITE_MORE or
450+ // fatal error ; the caller must check. If > 0 is returned, the packet is done
451451 // and the value is the size of the finalized packet. If 0 is returned,
452452 // the datagram is either congestion limited or was abandoned.
453453 ssize_t TryWritePendingDatagram (PathStorage* path,
@@ -539,11 +539,12 @@ class Session final : public AsyncWrap, private SessionTicket::AppData::Source {
539539 // the session, encapsulating ngtcp2 transport details here.
540540
541541 // Open a unidirectional stream, setting *id on success, or returning false
542- bool OpenUni (stream_id* id);
542+ bool OpenUnidirectionalStream (stream_id* id);
543543
544544 void ExtendMaxStreams (Direction direction, uint64_t max);
545545
546- // Signal that we've consumed $len bytes on stream $id to update flow control
546+ // Signal that we've consumed `len` bytes on stream `id` to update flow
547+ // control
547548 void Consume (stream_id id, size_t len);
548549
549550 // Record an application-level error on the connection without closing it.
0 commit comments