mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-13 21:07:02 -05:00
safe return in blackhole
This commit is contained in:
parent
237ccf505c
commit
c422196280
@ -26,13 +26,13 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dispatch implements OutboundHandler.Dispatch().
|
// Process implements OutboundHandler.Dispatch().
|
||||||
func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error {
|
func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error {
|
||||||
v.response.WriteTo(outboundRay.OutboundOutput())
|
v.response.WriteTo(outboundRay.OutboundOutput())
|
||||||
// Sleep a little here to make sure the response is sent to client.
|
// Sleep a little here to make sure the response is sent to client.
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
outboundRay.OutboundOutput().Close()
|
outboundRay.OutboundOutput().CloseError()
|
||||||
outboundRay.OutboundInput().CloseError()
|
time.Sleep(time.Second * 2)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user