v1.5.1 增强程序稳定性
This commit is contained in:
@@ -4,8 +4,10 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/TeaOSLab/EdgeNode/internal/utils/bytepool"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
@@ -126,6 +128,12 @@ func (this *HTTPRequest) doWebsocket(requestHost string, isLastRetry bool) (shou
|
||||
}()
|
||||
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println(fmt.Sprintf("[WEBSOCKET]goroutine panic: %v", r))
|
||||
}
|
||||
}()
|
||||
|
||||
// 读取第一个响应
|
||||
var respReader = NewWebsocketResponseReader(originConn)
|
||||
resp, respErr := http.ReadResponse(bufio.NewReader(respReader), this.RawReq)
|
||||
|
||||
Reference in New Issue
Block a user