Skip to content

Commit 35564bc

Browse files
committed
fix: close error nil conn
1 parent a30934c commit 35564bc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cmd/server/http_proxy/connect.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package http_proxy
33
import (
44
"context"
55
"crypto/tls"
6+
"errors"
7+
"io"
68
"net"
79
"net/http"
810
"sync"
@@ -101,7 +103,13 @@ func (i *interceptHandler) Close() {
101103
type channelListener chan net.Conn
102104

103105
func (cl channelListener) Accept() (net.Conn, error) {
104-
return <-cl, nil
106+
if conn, ok := <-cl; !ok {
107+
return nil, errors.New("channel closed")
108+
} else if conn == nil {
109+
return nil, io.EOF
110+
} else {
111+
return conn, nil
112+
}
105113
}
106114

107115
func (cl channelListener) Addr() net.Addr {

cmd/server/sessionmanager/bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)