MCPcopy
hub / github.com/grpc/grpc-go / handleNonGRPCData

Method handleNonGRPCData

internal/transport/client_stream.go:82–89  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
82func (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.
92func (s *ClientStream) Read(n int) (mem.BufferSlice, error) {

Callers 1

handleDataMethod · 0.80

Implementers 3

clientStreamstream.go
okStreaminternal/xds/httpfilter/fault/fault.go

Calls 4

finalizeNonGRPCStatusMethod · 0.95
StreamEndedMethod · 0.80
LenMethod · 0.65
ReadOnlyDataMethod · 0.65

Tested by

no test coverage detected