Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sbilly committed Nov 17, 2020
1 parent d547b42 commit 85558ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common/channel/quic/remote.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package quic

import (
"context"
"crypto/tls"

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

func servQUIC(lp quic.Listener) {
for {
sess, err := lp.Accept()
sess, err := lp.Accept(context.Background())
if nil != err {
continue
}
Expand Down
7 changes: 4 additions & 3 deletions common/mux/quic.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mux

import (
"context"
"net"
"sync/atomic"
"time"
Expand All @@ -23,7 +24,7 @@ func (q *QUICMuxSession) CloseStream(stream MuxStream) error {
}

func (q *QUICMuxSession) OpenStream() (MuxStream, error) {
s, err := q.OpenStreamSync()
s, err := q.OpenStreamSync(context.Background())
if nil != err {
return nil, err
}
Expand All @@ -32,7 +33,7 @@ func (q *QUICMuxSession) OpenStream() (MuxStream, error) {
}

func (q *QUICMuxSession) AcceptStream() (MuxStream, error) {
s, err := q.Session.AcceptStream()
s, err := q.Session.AcceptStream(context.Background())
if nil != err {
return nil, err
}
Expand All @@ -45,7 +46,7 @@ func (q *QUICMuxSession) NumStreams() int {

func (q *QUICMuxSession) Close() error {
q.streamCounter = 0
return q.Session.Close()
return q.Session.CloseWithError(0, "")
}
func (s *QUICMuxSession) RemoteAddr() net.Addr {
return nil
Expand Down

0 comments on commit 85558ae

Please sign in to comment.