Skip to content

Commit

Permalink
fix handleTcpOverMWSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Jun 22, 2020
1 parent 4580e63 commit f8b251e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/relay/mwss.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func (tr *mwssTransporter) Dial(addr string) (conn net.Conn, err error) {
// 找到可以用的session
for _, s := range sessions {
if s.session.NumStreams() >= s.maxStreamCnt {
log.Printf("session: %v reach the max stream count", s.session)
ok = false
} else {
session = s
Expand Down Expand Up @@ -139,7 +140,6 @@ func (tr *mwssTransporter) Dial(addr string) (conn net.Conn, err error) {
sessions = append(sessions, session)
}

log.Printf("[Handshake] now strems: %d", session.NumStreams())
cc, err := session.GetConn()
if err != nil {
session.Close()
Expand Down Expand Up @@ -305,6 +305,7 @@ func (r *Relay) handleTcpOverMWSS(c *net.TCPConn) error {
if err != nil {
return err
}
defer wsc.Close()
transport(wsc, c)
return nil
}
Expand Down

0 comments on commit f8b251e

Please sign in to comment.