mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-02-03 08:51:11 +08:00
[context] optimize context reset and reuse
This commit is contained in:
parent
450d6294ad
commit
1d5ffac153
2 changed files with 7 additions and 3 deletions
3
respw.go
3
respw.go
|
|
@ -33,13 +33,12 @@ type responseWriterImpl struct {
|
|||
|
||||
// NewResponseWriter 创建并返回一个 responseWriterImpl 实例
|
||||
func newResponseWriter(w http.ResponseWriter) ResponseWriter {
|
||||
rw := &responseWriterImpl{
|
||||
return &responseWriterImpl{
|
||||
ResponseWriter: w,
|
||||
status: 0, // 明确初始状态
|
||||
size: 0,
|
||||
hijacked: false,
|
||||
}
|
||||
return rw
|
||||
}
|
||||
|
||||
func (rw *responseWriterImpl) reset(w http.ResponseWriter) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue