mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-02-17 05:35:20 -05:00
refine error handling in retry logic
This commit is contained in:
@@ -66,10 +66,13 @@ func NewHandler(ctx context.Context, config *proxyman.OutboundHandlerConfig) (*H
|
||||
func (h *Handler) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) {
|
||||
err := h.proxy.Process(ctx, outboundRay, h)
|
||||
// Ensure outbound ray is properly closed.
|
||||
if err != nil && errors.Cause(err) != io.EOF {
|
||||
outboundRay.OutboundOutput().CloseError()
|
||||
} else {
|
||||
outboundRay.OutboundOutput().Close()
|
||||
if err != nil {
|
||||
log.Warning("Proxyman|OutboundHandler: Failed to process outbound traffic.")
|
||||
if errors.Cause(err) != io.EOF {
|
||||
outboundRay.OutboundOutput().CloseError()
|
||||
} else {
|
||||
outboundRay.OutboundOutput().Close()
|
||||
}
|
||||
}
|
||||
outboundRay.OutboundInput().CloseError()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user