mirror of
https://gitee.com/johng/gf
synced 2026-06-07 10:22:11 +08:00
ghttp.Request增加Exit
This commit is contained in:
@ -293,7 +293,7 @@ func (r *Request) Exit() {
|
||||
}
|
||||
|
||||
// 判断当前请求是否停止执行
|
||||
func (r *Request) IsExit() bool {
|
||||
func (r *Request) IsExited() bool {
|
||||
return r.exit.Val()
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user