MCPcopy Create free account
hub / github.com/SenseUnit/dumbproxy / Read

Method Read

dialer/optimistic.go:137–154  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

135}
136
137func (c *futureH1ProxiedConn) Read(b []byte) (n int, err error) {
138 if c.rErr != nil {
139 return 0, c.rErr
140 }
141 if !c.rDone {
142 resp, err := readResponse(c.Conn)
143 if err != nil {
144 c.rErr = fmt.Errorf("reading proxy response failed: %w", err)
145 return 0, c.rErr
146 }
147 if resp.StatusCode != http.StatusOK {
148 c.rErr = fmt.Errorf("bad status code from proxy: %d", resp.StatusCode)
149 return 0, c.rErr
150 }
151 c.rDone = true
152 }
153 return c.Conn.Read(b)
154}

Callers

nothing calls this directly

Calls 2

readResponseFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected