Skip to content

Commit

Permalink
webtransport: return error before wrapping opened / accepted streams
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Sep 22, 2022
1 parent 17a342c commit d46dc5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions p2p/transport/webtransport/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ func newConn(tr tpt.Transport, sess *webtransport.Session, sconn *connSecurityMu

func (c *conn) OpenStream(ctx context.Context) (network.MuxedStream, error) {
str, err := c.session.OpenStreamSync(ctx)
if err != nil {
return nil, err
}
return &stream{str}, err
}

func (c *conn) AcceptStream() (network.MuxedStream, error) {
str, err := c.session.AcceptStream(context.Background())
if err != nil {
return nil, err
}
return &stream{str}, err
}

Expand Down

0 comments on commit d46dc5c

Please sign in to comment.