diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/unit/response.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/go/unit/response.go b/src/go/unit/response.go index 18daa2f3..258a82c9 100644 --- a/src/go/unit/response.go +++ b/src/go/unit/response.go @@ -13,7 +13,6 @@ import "C" import ( "fmt" "net/http" - "os" ) type response struct { @@ -43,16 +42,15 @@ func (r *response) Write(p []byte) (n int, err error) { } l := C.size_t(len(p)) - b := getCBytes(p) + b := buf_ref(p) res := C.nxt_go_response_write(r.c_req, b, l) - C.free(b) return int(res), nil } func (r *response) WriteHeader(code int) { if r.headerSent { // Note: explicitly using Stderr, as Stdout is our HTTP output. - fmt.Fprintf(os.Stderr, "CGI attempted to write header twice") + nxt_go_warn("multiple response.WriteHeader calls") return } r.headerSent = true |