1
0
mirror of https://github.com/labstack/echo.git synced 2025-12-03 22:59:09 +02:00

Revert "Fixed Request.Out"

This reverts commit cced590a16.
This commit is contained in:
Vishal Rana
2015-12-21 15:18:53 -08:00
parent cced590a16
commit 72050d765b
8 changed files with 237 additions and 191 deletions

View File

@@ -275,8 +275,7 @@ func (n *node) check405() HandlerFunc {
return notFoundHandler
}
func (r *Router) Find(method, path string, context Context) (h HandlerFunc, e *Echo) {
x := context.X()
func (r *Router) Find(method, path string, x *context) (h HandlerFunc, e *Echo) {
h = notFoundHandler
e = r.echo
cn := r.tree // Current node as root
@@ -402,12 +401,11 @@ End:
}
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// TODO: v2
// c := r.echo.pool.Get().(*context)
// h, _ := r.Find(req.Method, req.URL.Path, c)
// c.reset(req, w, r.echo)
// if err := h(c); err != nil {
// r.echo.httpErrorHandler(err, c)
// }
// r.echo.pool.Put(c)
c := r.echo.pool.Get().(*context)
h, _ := r.Find(req.Method, req.URL.Path, c)
c.reset(req, w, r.echo)
if err := h(c); err != nil {
r.echo.httpErrorHandler(err, c)
}
r.echo.pool.Put(c)
}