Improve error processing

This commit is contained in:
世界
2022-07-30 09:57:02 +08:00
parent 9b9b5ebb72
commit d3378a575c
8 changed files with 38 additions and 8 deletions

View File

@@ -28,6 +28,7 @@ func NewConnection(ctx context.Context, router adapter.Router, errorHandler E.Ha
if err != nil {
return err
}
stream = &wrapStream{stream}
request, err := ReadRequest(stream)
if err != nil {
return err
@@ -37,7 +38,6 @@ func NewConnection(ctx context.Context, router adapter.Router, errorHandler E.Ha
go func() {
logger.InfoContext(ctx, "inbound multiplex connection to ", metadata.Destination)
hErr := router.RouteConnection(ctx, &ServerConn{ExtendedConn: bufio.NewExtendedConn(stream)}, metadata)
// hErr := router.RouteConnection(ctx, &ServerConn{ExtendedConn: bufio.NewExtendedConn(stream)}, metadata)
if hErr != nil {
errorHandler.NewError(ctx, hErr)
}