Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should clear HttpContext's filters when reset #252

Closed
dk-lockdown opened this issue Sep 22, 2021 · 0 comments
Closed

should clear HttpContext's filters when reset #252

dk-lockdown opened this issue Sep 22, 2021 · 0 comments
Assignees

Comments

@dk-lockdown
Copy link
Contributor

see manager.go

// ServeHTTP http request entrance.
func (s *DefaultHttpWorker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	hc := s.pool.Get().(*h.HttpContext)
	defer s.pool.Put(hc)

	hc.Request = r
	hc.ResetWritermen(w)
	hc.Reset()

	// now only one filter http_connection_manager, so just get it and call
	err := s.ls.nf.OnData(hc)

	if err != nil {
		s.pool.Put(hc)
		logger.Errorf("ServeHTTP %s", err)
	}
}
func (hcm *HttpConnectionManager) OnData(hc *pch.HttpContext) error {
	hc.Ctx = context.Background()
	err := hcm.findRoute(hc)
	if err != nil {
		return err
	}
	hcm.addFilter(hc)
	hcm.handleHTTPRequest(hc)
	return nil
}

What happened:

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants