Read overrides the Read method from io package that will add the number of bytes read to the CountedRequestReader struct for retrieval for the stat on the database
(buf []byte)
| 28 | // Read overrides the Read method from io package that will add the number of bytes read to the CountedRequestReader struct for |
| 29 | // retrieval for the stat on the database |
| 30 | func (c *CountedRequestReader) Read(buf []byte) (int, error) { |
| 31 | numBytesRead, err := c.reader.Read(buf) |
| 32 | |
| 33 | if !c.bodyRead { |
| 34 | c.numBytes += int64(numBytesRead) |
| 35 | } |
| 36 | return numBytesRead, err |
| 37 | } |
| 38 | |
| 39 | // GetBodyBytesCount will load the number of bytes read for the request from the CountedRequestReader struct. If count |
| 40 | // is 0 its possible we haven't yet read the body so will do that in the event of 0 count. |
no outgoing calls
no test coverage detected