From 3cdde280ba6919a36a6d6a9dc122ed258a962a36 Mon Sep 17 00:00:00 2001 From: Mathis Engelbart Date: Fri, 28 Aug 2026 12:21:47 +0200 Subject: [PATCH] Fix typos --- examples/interop/main.go | 3 ++- quic_connection.go | 32 ++++++++++++++++---------------- send_flow.go | 2 +- session.go | 20 +++++++++++--------- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/examples/interop/main.go b/examples/interop/main.go index b9d5a4a..cabc001 100644 --- a/examples/interop/main.go +++ b/examples/interop/main.go @@ -266,7 +266,8 @@ func generateTLSConfigWithCertAndKey(certFile, keyFile string, keyLog io.Writer) }, nil } -// Setup a bare-bones TLS config for the server +// generateTLSConfigWithNewCert sets up a bare-bones TLS config for the +// server, using a freshly generated self-signed certificate. func generateTLSConfigWithNewCert(keyLog io.Writer) (*tls.Config, error) { key, err := rsa.GenerateKey(rand.Reader, 1024) if err != nil { diff --git a/quic_connection.go b/quic_connection.go index 7db4899..2d0b70a 100644 --- a/quic_connection.go +++ b/quic_connection.go @@ -6,51 +6,51 @@ import ( "github.com/quic-go/quic-go" ) -type QuicGoReceiveStream struct { +type QUICGoReceiveStream struct { stream *quic.ReceiveStream } -func NewQuicGoReceiveStream(stream *quic.ReceiveStream) *QuicGoReceiveStream { - return &QuicGoReceiveStream{ +func NewQUICGoReceiveStream(stream *quic.ReceiveStream) *QUICGoReceiveStream { + return &QUICGoReceiveStream{ stream: stream, } } -func (s *QuicGoReceiveStream) ID() int64 { +func (s *QUICGoReceiveStream) ID() int64 { return int64(s.stream.StreamID()) } -func (s *QuicGoReceiveStream) CancelRead(c uint64) { +func (s *QUICGoReceiveStream) CancelRead(c uint64) { s.stream.CancelRead(quic.StreamErrorCode(c)) } -func (c *QuicGoReceiveStream) Read(p []byte) (n int, err error) { - return c.stream.Read(p) +func (s *QUICGoReceiveStream) Read(p []byte) (n int, err error) { + return s.stream.Read(p) } -type QuicGoSendStream struct { +type QUICGoSendStream struct { stream *quic.SendStream } -func NewQuicstream(stream *quic.SendStream) *QuicGoSendStream { - return &QuicGoSendStream{ +func NewQUICGoSendStream(stream *quic.SendStream) *QUICGoSendStream { + return &QUICGoSendStream{ stream: stream, } } -func (s *QuicGoSendStream) ID() int64 { +func (s *QUICGoSendStream) ID() int64 { return int64(s.stream.StreamID()) } -func (s *QuicGoSendStream) Write(b []byte) (int, error) { +func (s *QUICGoSendStream) Write(b []byte) (int, error) { return s.stream.Write(b) } -func (s *QuicGoSendStream) Close() error { +func (s *QUICGoSendStream) Close() error { return s.stream.Close() } -func (s *QuicGoSendStream) CancelWrite(c uint64) { +func (s *QUICGoSendStream) CancelWrite(c uint64) { s.stream.CancelWrite(quic.StreamErrorCode(c)) } @@ -77,7 +77,7 @@ func (c *QUICGoConnection) OpenUniStreamSync(ctx context.Context) (SendStream, e if err != nil { return nil, err } - return &QuicGoSendStream{ + return &QUICGoSendStream{ stream: s, }, nil } @@ -87,7 +87,7 @@ func (c *QUICGoConnection) AcceptUniStream(ctx context.Context) (ReceiveStream, if err != nil { return nil, err } - return &QuicGoReceiveStream{ + return &QUICGoReceiveStream{ stream: s, }, nil } diff --git a/send_flow.go b/send_flow.go index 27271ff..1521334 100644 --- a/send_flow.go +++ b/send_flow.go @@ -37,7 +37,7 @@ func newFlow(conn Connection, id uint64, onClose func(), qlog *qlog.Logger) *Sen } } -// WriteRTP sends an RTP or RTCP packet as a QUIC Datagram. +// WriteRTPBytes sends an RTP or RTCP packet as a QUIC Datagram. func (f *SendFlow) WriteRTPBytes(packet []byte) error { if err := f.isClosed(); err != nil { return err diff --git a/session.go b/session.go index 64a2100..c0c2b89 100644 --- a/session.go +++ b/session.go @@ -66,9 +66,10 @@ func NewSession(conn Connection, acceptDatagrams bool, qlogger *qlog.Logger) (*S return s, nil } -// NewSessionWithAppHandeledConn creates a new roq session. QUIC connection is handled by application. -// HandleDatagram and HandleUniStreamWithFlowID have to be called for each datagram / new stream. -func NewSessionWithAppHandeledConn(conn Connection, acceptDatagrams bool, qlogger *qlog.Logger) (*Session, error) { +// NewSessionWithAppHandledConn creates a new roq session. QUIC connection is +// handled by the application. HandleDatagram and HandleUniStreamWithFlowID have +// to be called for each datagram / new stream. +func NewSessionWithAppHandledConn(conn Connection, acceptDatagrams bool, qlogger *qlog.Logger) (*Session, error) { s := newSession(conn, acceptDatagrams, qlogger) return s, nil @@ -210,9 +211,9 @@ func (s *Session) receiveDatagrams() error { } } -// HandleUniStreamWithFlowID handles a datagram. -// If QUIC connection is handled by the application, this function has to be called by the application -// for each datagram that belongs to belongs to the roq connnection. +// HandleDatagram handles a datagram. If QUIC connection is handled by the +// application, this function has to be called by the application for each +// datagram that belongs to the roq connection. func (s *Session) HandleDatagram(datagram []byte) { flowID, n, err := quicvarint.Parse(datagram) if err != nil { @@ -249,9 +250,10 @@ func (s *Session) HandleDatagram(datagram []byte) { f.push(b) } -// HandleUniStreamWithFlowID handles a new flow with the flowID allready parsed. -// If QUIC connection is handled by the application, this function has to be called by the application -// for each new QUIC stream containing a roq floqID. +// HandleUniStreamWithFlowID handles a new stream with the flow ID already +// parsed. If QUIC connection is handled by the application, this function has to +// be called by the application for each new QUIC stream containing a roq flow +// ID. func (s *Session) HandleUniStreamWithFlowID(flowID uint64, rs ReceiveStream) { if s.qlog != nil { s.qlog.Log(roqqlog.StreamOpenedEvent{