From 5d6c686d80ff4539e41f71abcfcd8469822f5d3b Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 30 Oct 2018 08:57:58 -0700 Subject: [PATCH] Fixing race in plugin HandleHTTP. (#9754) --- plugin/client_rpc.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin/client_rpc.go b/plugin/client_rpc.go index 2e85466d7e..564d79d160 100644 --- a/plugin/client_rpc.go +++ b/plugin/client_rpc.go @@ -277,7 +277,6 @@ func (g *hooksRPCClient) ServeHTTP(c *Context, w http.ResponseWriter, r *http.Re connection, err := g.muxBroker.Accept(serveHTTPStreamId) if err != nil { g.log.Error("Plugin failed to ServeHTTP, muxBroker couldn't accept connection", mlog.Uint32("serve_http_stream_id", serveHTTPStreamId), mlog.Err(err)) - http.Error(w, "500 internal server error", http.StatusInternalServerError) return } defer connection.Close() @@ -285,7 +284,6 @@ func (g *hooksRPCClient) ServeHTTP(c *Context, w http.ResponseWriter, r *http.Re rpcServer := rpc.NewServer() if err := rpcServer.RegisterName("Plugin", &httpResponseWriterRPCServer{w: w}); err != nil { g.log.Error("Plugin failed to ServeHTTP, coulden't register RPC name", mlog.Err(err)) - http.Error(w, "500 internal server error", http.StatusInternalServerError) return } rpcServer.ServeConn(connection) @@ -298,7 +296,6 @@ func (g *hooksRPCClient) ServeHTTP(c *Context, w http.ResponseWriter, r *http.Re bodyConnection, err := g.muxBroker.Accept(requestBodyStreamId) if err != nil { g.log.Error("Plugin failed to ServeHTTP, muxBroker couldn't Accept request body connection", mlog.Err(err)) - http.Error(w, "500 internal server error", http.StatusInternalServerError) return } defer bodyConnection.Close()