Client should have a check on maximum size of received message size.

This commit is contained in:
Mahak Mukhi
2017-03-09 16:58:23 -08:00
parent 4eaacfed97
commit a94b0948a3
4 changed files with 80 additions and 37 deletions

View File

@ -36,7 +36,6 @@ package grpc
import (
"bytes"
"io"
"math"
"time"
"golang.org/x/net/context"
@ -73,7 +72,7 @@ func recvResponse(ctx context.Context, dopts dialOptions, t transport.ClientTran
}
}
for {
if err = recv(p, dopts.codec, stream, dopts.dc, reply, math.MaxInt32, inPayload); err != nil {
if err = recv(p, dopts.codec, stream, dopts.dc, reply, dopts.maxMsgSize, inPayload); err != nil {
if err == io.EOF {
break
}