Skip to content

Commit 7bd84d1

Browse files
committed
Enhance HTTP request error logging by adding log output for failed direct requests to Socks5 and H3.
1 parent 24540b3 commit 7bd84d1

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

libcore/http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ func (r *httpRequest) Execute() (HTTPResponse, error) {
214214
}
215215
response, err := r.h1h2Client.Do(&r.request)
216216
if err != nil {
217+
log.Println("http execute via socks5 failed:", err)
217218
// trySocks5 && tryH3Direct
218219
if r.tryH3Direct && errors.Is(err, errFailConnectSocks5) {
220+
log.Println("http execute: socks5 unavailable, falling back to H3 direct")
219221
return r.doH3Direct()
220222
}
221223
return nil, err
@@ -305,6 +307,7 @@ func (r *httpRequest) doH3Direct() (HTTPResponse, error) {
305307
// 执行HTTP请求
306308
rsp, err := f()
307309
if rsp == nil || err != nil {
310+
log.Println("h3 direct request", t, "failed:", err)
308311
mu.Lock()
309312
finalErr = errors.Join(finalErr, fmt.Errorf("%s: %w", t, err))
310313
mu.Unlock()

0 commit comments

Comments
 (0)