summaryrefslogtreecommitdiff
path: root/plugins/http/handler.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-11-19 17:28:30 +0300
committerValery Piashchynski <[email protected]>2020-11-19 17:28:30 +0300
commit71c81a91f9f967e41310077bd26b1dedb0b49556 (patch)
treecce9cb740bae0b9acbfc15d76823174f571a0a6c /plugins/http/handler.go
parente9595a5c133ff02b765c0b59913593e7f91bc4e7 (diff)
huge linters fix update
Diffstat (limited to 'plugins/http/handler.go')
-rw-r--r--plugins/http/handler.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/http/handler.go b/plugins/http/handler.go
index efca6001..f770a401 100644
--- a/plugins/http/handler.go
+++ b/plugins/http/handler.go
@@ -161,6 +161,8 @@ func (h *handler) maxSize(w http.ResponseWriter, r *http.Request, start time.Tim
// handleError sends error.
func (h *handler) handleError(w http.ResponseWriter, r *http.Request, err error, start time.Time) {
+ h.mul.Lock()
+ defer h.mul.Unlock()
// if pipe is broken, there is no sense to write the header
// in this case we just report about error
if err == errEPIPE {
@@ -188,9 +190,6 @@ func (h *handler) handleResponse(req *Request, resp *Response, start time.Time)
// throw invokes event handler if any.
func (h *handler) throw(ctx interface{}) {
- h.mul.Lock()
- defer h.mul.Unlock()
-
if h.lsn != nil {
h.lsn(ctx)
}