1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-06 03:27:27 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-03-17 22:43:04 +02:00
parent 9cf6f9fa5e
commit 1128a973af
9 changed files with 86 additions and 80 deletions

View File

@@ -26,13 +26,17 @@ func (c *Pool) Acquire(w http.ResponseWriter, r *http.Request) *Context {
// Release puts a Context back to its pull, this function releases its resources.
// See Acquire.
func (c *Pool) Release(ctx *Context) {
ctx.EndRequest()
c.pool.Put(ctx)
if !ctx.manualRelease {
ctx.EndRequest()
c.pool.Put(ctx)
}
}
// ReleaseLight will just release the object back to the pool, but the
// clean method is caller's responsibility now, currently this is only used
// on `SPABuilder`.
// on `SPABuilder` and `websocket.Handler`.
//
// ReleaseLight does a force-put, it does NOT respect the context.DisablePoolRelease.
func (c *Pool) ReleaseLight(ctx *Context) {
c.pool.Put(ctx)
}