Go: http.Flusher implemented by unit.response.

This closes #133 issue on GitHub.
This commit is contained in:
Max Romanov
2018-07-12 15:50:43 +03:00
parent 96a4f9f032
commit e6cd1c4257
3 changed files with 27 additions and 0 deletions

View File

@@ -65,3 +65,11 @@ func (r *response) WriteHeader(code int) {
r.Write([]byte("\r\n"))
}
func (r *response) Flush() {
if !r.headerSent {
r.WriteHeader(http.StatusOK)
}
C.nxt_go_response_flush(r.c_req)
}