()
| 889 | } |
| 890 | |
| 891 | func (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 | |
| 921 | type firstByteReader struct { |
| 922 | c net.Conn |
no test coverage detected