handleNonGRPCData collects non-gRPC body from the given data frame. It returns non-nil value when the stream should be closed with it.
(f *parsedDataFrame)
| 80 | // handleNonGRPCData collects non-gRPC body from the given data frame. |
| 81 | // It returns non-nil value when the stream should be closed with it. |
| 82 | func (s *ClientStream) handleNonGRPCData(f *parsedDataFrame) *status.Status { |
| 83 | n := min(f.data.Len(), nonGRPCDataMaxLen-len(s.nonGRPCDataBuf)) |
| 84 | s.nonGRPCDataBuf = append(s.nonGRPCDataBuf, f.data.ReadOnlyData()[0:n]...) |
| 85 | if len(s.nonGRPCDataBuf) >= nonGRPCDataMaxLen || f.StreamEnded() { |
| 86 | return s.finalizeNonGRPCStatus() |
| 87 | } |
| 88 | return nil |
| 89 | } |
| 90 | |
| 91 | // Read reads an n byte message from the input stream. |
| 92 | func (s *ClientStream) Read(n int) (mem.BufferSlice, error) { |
no test coverage detected