bugfix: Delete put(c) HandleContext

This method "engine.pool.Put(c)" may put c twice in pool, this is a bug may cause a request with no response and another response with more than one response body.
This commit is contained in:
Zhuo Zhao 2018-09-30 20:31:12 +08:00 committed by GitHub
parent 91a4459dd2
commit 1a0a349494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
gin.go
View File

@ -336,7 +336,6 @@ func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) {
func (engine *Engine) HandleContext(c *Context) { func (engine *Engine) HandleContext(c *Context) {
c.reset() c.reset()
engine.handleHTTPRequest(c) engine.handleHTTPRequest(c)
engine.pool.Put(c)
} }
func (engine *Engine) handleHTTPRequest(c *Context) { func (engine *Engine) handleHTTPRequest(c *Context) {