MCPcopy Create free account
hub / github.com/couchbase/cbft / Write

Method Write

cmd/cbft/timeout_handler.go:135–145  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

133func (tw *timeoutWriter) Header() http.Header { return tw.h }
134
135func (tw *timeoutWriter) Write(p []byte) (int, error) {
136 tw.mu.Lock()
137 defer tw.mu.Unlock()
138 if tw.timedOut {
139 return 0, http.ErrHandlerTimeout
140 }
141 if !tw.wroteHeader {
142 tw.writeHeaderLocked(http.StatusOK)
143 }
144 return tw.w.Write(p)
145}
146
147func (tw *timeoutWriter) writeHeaderLocked(code int) {
148 checkWriteHeaderCode(code)

Callers

nothing calls this directly

Calls 1

writeHeaderLockedMethod · 0.95

Tested by

no test coverage detected