ghttp.Request增加Exit

This commit is contained in:
John
2018-04-16 16:50:26 +08:00
parent 38ba66db70
commit 2412b23906
2 changed files with 3 additions and 3 deletions

View File

@ -293,7 +293,7 @@ func (r *Request) Exit() {
}
// 判断当前请求是否停止执行
func (r *Request) IsExit() bool {
func (r *Request) IsExited() bool {
return r.exit.Val()
}

View File

@ -64,12 +64,12 @@ func (s *Server)callHandler(h *HandlerItem, r *Request) {
// 新建一个控制器对象处理请求
c := reflect.New(h.ctype)
c.MethodByName("Init").Call([]reflect.Value{reflect.ValueOf(r)})
if !r.IsExit() {
if !r.IsExited() {
c.MethodByName(h.fname).Call(nil)
}
c.MethodByName("Shut").Call([]reflect.Value{reflect.ValueOf(r)})
} else {
if !r.IsExit() {
if !r.IsExited() {
h.faddr(r)
}
}