MCPcopy
hub / github.com/valyala/fasthttp / reset

Method reset

server.go:891–919  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

889}
890
891func (ctx *RequestCtx) reset() {
892 ctx.Request.Reset()
893 ctx.Response.Reset()
894 ctx.fbr.reset()
895
896 ctx.connID = 0
897 ctx.connRequestNum = 0
898 ctx.connTime = zeroTime
899 ctx.remoteAddr = nil
900 ctx.time = zeroTime
901 ctx.c = nil
902
903 // Don't reset ctx.s!
904 // We have a pool per server so the next time this ctx is used it
905 // will be assigned the same value again.
906 // ctx might still be in use for context.Done() and context.Err()
907 // which are safe to use as they only use ctx.s and no other value.
908
909 if ctx.timeoutResponse != nil {
910 ctx.timeoutResponse.Reset()
911 }
912
913 if ctx.timeoutTimer != nil {
914 stopTimer(ctx.timeoutTimer)
915 }
916
917 ctx.hijackHandler = nil
918 ctx.hijackNoResponse = false
919}
920
921type firstByteReader struct {
922 c net.Conn

Callers 1

releaseCtxMethod · 0.45

Calls 2

stopTimerFunction · 0.85
ResetMethod · 0.65

Tested by

no test coverage detected