mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-17 22:32:26 +08:00
make it clear that the context will be reset after the request ends.
This commit is contained in:
parent
7742ff50e0
commit
6e5017ad0f
3
gin.go
3
gin.go
@ -371,10 +371,11 @@ func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
c := engine.pool.Get().(*Context)
|
||||
c.writermem.reset(w)
|
||||
c.Request = req
|
||||
c.reset()
|
||||
|
||||
engine.handleHTTPRequest(c)
|
||||
|
||||
// Given expectations, make it clear that the context will be reset after the request ends.
|
||||
c.reset()
|
||||
engine.pool.Put(c)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user