-
Notifications
You must be signed in to change notification settings - Fork 4.7k
grpc: support per-message compression and enforce embedding in ServerTransportStream implementations #8972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
grpc: support per-message compression and enforce embedding in ServerTransportStream implementations #8972
Changes from 6 commits
e311529
846f339
b1e38ee
1feab8c
a7ff095
99f8640
731535b
489f488
9e906cb
a8bf7be
04e6bdc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1470,7 +1470,11 @@ func (s *Server) processUnaryRPC(ctx context.Context, stream *transport.ServerSt | |
| if stream.SendCompress() != sendCompressorName { | ||
| comp = encoding.GetCompressor(stream.SendCompress()) | ||
| } | ||
| if err := s.sendResponse(ctx, stream, reply, cp, opts, comp); err != nil { | ||
| compV0, compV1 := cp, comp | ||
| if stream.IsDoNotCompress() { | ||
| compV0, compV1 = nil, nil | ||
| } | ||
|
Comment on lines
+1473
to
+1476
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is executed before the server handler is invoked. This would mean that stream.IsCompressionEnabled would always return true. Am I missing something here? Do we really need this check here? And if we really need this check, why is it missing for the streaming case? |
||
| if err := s.sendResponse(ctx, stream, reply, compV0, opts, compV1); err != nil { | ||
| if err == io.EOF { | ||
| // The entire stream is done (for unary RPC only). | ||
| return err | ||
|
|
||
|
arjan-bal marked this conversation as resolved.
|
Uh oh!
There was an error while loading. Please reload this page.