MCPcopy
hub / github.com/labstack/echo / Flush

Method Flush

middleware/compress.go:183–199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181}
182
183func (w *gzipResponseWriter) Flush() {
184 if !w.minLengthExceeded {
185 // Enforce compression because we will not know how much more data will come
186 w.minLengthExceeded = true
187 w.Header().Set(echo.HeaderContentEncoding, gzipScheme) // Issue #806
188 if w.wroteHeader {
189 w.ResponseWriter.WriteHeader(w.code)
190 }
191
192 _, _ = w.Writer.Write(w.buffer.Bytes())
193 }
194
195 if gw, ok := w.Writer.(*gzip.Writer); ok {
196 gw.Flush()
197 }
198 _ = http.NewResponseController(w.ResponseWriter).Flush()
199}
200
201func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
202 return http.NewResponseController(w.ResponseWriter).Hijack()

Callers 2

TestGzip_chunkedFunction · 0.45

Calls 4

SetMethod · 0.80
HeaderMethod · 0.45
WriteHeaderMethod · 0.45
WriteMethod · 0.45

Tested by 2

TestGzip_chunkedFunction · 0.36