MCPcopy Create free account
hub / github.com/erpc/erpc / Write

Method Write

erpc/http_timeout.go:170–180  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

168func (tw *timeoutWriter) Header() http.Header { return tw.h }
169
170func (tw *timeoutWriter) Write(p []byte) (int, error) {
171 tw.mu.Lock()
172 defer tw.mu.Unlock()
173 if tw.err != nil {
174 return 0, tw.err
175 }
176 if !tw.wroteHeader {
177 tw.writeHeaderLocked(http.StatusOK)
178 }
179 return tw.wbuf.Write(p)
180}
181
182func (tw *timeoutWriter) writeHeaderLocked(code int) {
183 switch {

Callers 15

LockMethod · 0.45
createTempFileFunction · 0.45
fetchPrometheusMetricsFunction · 0.45
handleSingleRequestMethod · 0.45
sendErrorResponseMethod · 0.45
handleMethod · 0.45
writerMethod · 0.45
writeMethod · 0.45
newBenchUpstreamFunction · 0.45
handleHealthCheckMethod · 0.45

Calls 3

writeHeaderLockedMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65