(b []byte)
| 135 | } |
| 136 | |
| 137 | func (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 | } |
nothing calls this directly
no test coverage detected