Skip to content

Commit

Permalink
http3: hide SendDatagram and ReceiveDatagram on the Connection (#4427)
Browse files Browse the repository at this point in the history
HTTP datagrams are bound to streams. It shouldn't be possible to send
datagrams on the http3.Connection.
  • Loading branch information
marten-seemann committed Apr 11, 2024
1 parent da410a7 commit b096e94
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion http3/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package http3

import (
"context"
"net"
"sync/atomic"

"github.com/quic-go/quic-go"
Expand All @@ -11,7 +12,19 @@ import (
)

type Connection interface {
quic.Connection
// all methods from the quic.Connection expect for SendDatagram and ReceiveDatagram
AcceptStream(context.Context) (quic.Stream, error)
AcceptUniStream(context.Context) (quic.ReceiveStream, error)
OpenStream() (quic.Stream, error)
OpenStreamSync(context.Context) (quic.Stream, error)
OpenUniStream() (quic.SendStream, error)
OpenUniStreamSync(context.Context) (quic.SendStream, error)
LocalAddr() net.Addr
RemoteAddr() net.Addr
CloseWithError(quic.ApplicationErrorCode, string) error
Context() context.Context
ConnectionState() quic.ConnectionState

// ReceivedSettings returns a channel that is closed once the client's SETTINGS frame was received.
ReceivedSettings() <-chan struct{}
// Settings returns the settings received on this connection.
Expand Down

0 comments on commit b096e94

Please sign in to comment.