v1.5.1 增强程序稳定性
This commit is contained in:
@@ -6,8 +6,10 @@ package http3
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/quic-go/quic-go"
|
||||
http3quic "github.com/quic-go/quic-go/http3"
|
||||
"log"
|
||||
"net"
|
||||
"net/http"
|
||||
)
|
||||
@@ -45,6 +47,12 @@ func (this *Server) Serve(listener Listener) error {
|
||||
continue
|
||||
}
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
log.Println(fmt.Sprintf("[HTTP3]goroutine panic: %v", r))
|
||||
}
|
||||
}()
|
||||
|
||||
// 通知ConnState
|
||||
if this.ConnState != nil {
|
||||
netConn, isNetConn := conn.(net.Conn)
|
||||
|
||||
Reference in New Issue
Block a user