Skip to content

Commit

Permalink
Merge pull request #191 from tmc/tmc.better_eof_handling
Browse files Browse the repository at this point in the history
return err early if EOF to prevent logging in normal conditions
  • Loading branch information
yugui committed Jul 23, 2016
2 parents f52d055 + b069c86 commit a8f25bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/examplepb/flow_combination.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/examplepb/stream.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions protoc-gen-grpc-gateway/gengateway/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ var (
handleSend := func() error {
var protoReq {{.Method.RequestType.GoType .Method.Service.File.GoPkg.Path}}
err = dec.Decode(&protoReq)
if err == io.EOF {
return err
}
if err != nil {
grpclog.Printf("Failed to decode request: %v", err)
return err
Expand Down

0 comments on commit a8f25bd

Please sign in to comment.