MCPcopy
hub / github.com/cloudflare/cloudflared / Copy

Function Copy

cfio/copy.go:16–27  ·  view source on GitHub ↗
(dst io.Writer, src io.Reader)

Source from the content-addressed store, hash-verified

14}
15
16func Copy(dst io.Writer, src io.Reader) (written int64, err error) {
17 _, okWriteTo := src.(io.WriterTo)
18 _, okReadFrom := dst.(io.ReaderFrom)
19 var buffer []byte = nil
20
21 if !(okWriteTo || okReadFrom) {
22 buffer = bufferPool.Get().([]byte)
23 defer bufferPool.Put(buffer)
24 }
25
26 return io.CopyBuffer(dst, src, buffer)
27}

Callers 3

proxyHTTPRequestMethod · 0.92
TestProxySSEAllDataFunction · 0.92
copyDataFunction · 0.92

Calls 1

GetMethod · 0.80

Tested by 1

TestProxySSEAllDataFunction · 0.74