From c422196280347eff800f9340ed8c900789308a88 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sat, 11 Feb 2017 00:41:14 +0100 Subject: [PATCH] safe return in blackhole --- proxy/blackhole/blackhole.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/blackhole/blackhole.go b/proxy/blackhole/blackhole.go index 5b7d9fd4..d0be916d 100644 --- a/proxy/blackhole/blackhole.go +++ b/proxy/blackhole/blackhole.go @@ -26,13 +26,13 @@ func New(ctx context.Context, config *Config) (*Handler, error) { }, nil } -// Dispatch implements OutboundHandler.Dispatch(). +// Process implements OutboundHandler.Dispatch(). func (v *Handler) Process(ctx context.Context, outboundRay ray.OutboundRay, dialer proxy.Dialer) error { v.response.WriteTo(outboundRay.OutboundOutput()) // Sleep a little here to make sure the response is sent to client. time.Sleep(time.Second) - outboundRay.OutboundOutput().Close() - outboundRay.OutboundInput().CloseError() + outboundRay.OutboundOutput().CloseError() + time.Sleep(time.Second * 2) return nil }