|
|
@ -76,15 +76,13 @@ func (h *Handler) Tag() string {
|
|
|
|
// Dispatch implements proxy.Outbound.Dispatch.
|
|
|
|
// Dispatch implements proxy.Outbound.Dispatch.
|
|
|
|
func (h *Handler) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) {
|
|
|
|
func (h *Handler) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) {
|
|
|
|
if h.mux != nil {
|
|
|
|
if h.mux != nil {
|
|
|
|
err := h.mux.Dispatch(ctx, outboundRay)
|
|
|
|
if err := h.mux.Dispatch(ctx, outboundRay); err != nil {
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog()
|
|
|
|
newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog()
|
|
|
|
outboundRay.OutboundOutput().CloseError()
|
|
|
|
outboundRay.OutboundOutput().CloseError()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
err := h.proxy.Process(ctx, outboundRay, h)
|
|
|
|
if err := h.proxy.Process(ctx, outboundRay, h); err != nil {
|
|
|
|
// Ensure outbound ray is properly closed.
|
|
|
|
// Ensure outbound ray is properly closed.
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog()
|
|
|
|
newError("failed to process outbound traffic").Base(err).WithContext(ctx).WriteToLog()
|
|
|
|
outboundRay.OutboundOutput().CloseError()
|
|
|
|
outboundRay.OutboundOutput().CloseError()
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|