MCPcopy Index your code
hub / github.com/imroc/req / Read

Method Read

middleware.go:389–408  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

387}
388
389func (r *callbackReader) Read(p []byte) (n int, err error) {
390 n, err = r.ReadCloser.Read(p)
391 if n <= 0 {
392 if err == io.EOF && r.read > r.lastRead {
393 r.callback(r.read)
394 r.lastRead = r.read
395 }
396 return
397 }
398 r.read += int64(n)
399 if err == io.EOF {
400 r.callback(r.read)
401 r.lastRead = r.read
402 } else if now := time.Now(); now.Sub(r.lastTime) >= r.interval {
403 r.lastTime = now
404 r.callback(r.read)
405 r.lastRead = r.read
406 }
407 return
408}
409
410func handleDownload(c *Client, r *Response) (err error) {
411 if r.Response == nil || !r.Request.isSaveResponse {

Callers 1

writeMultipartFormFileFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected