You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Needed Header/Trailer sniffing in server interceptor. It could be done by wrapping ServerTransportStream and attaching it to the context using NewContextWithServerTransportStream. But there is no clear API access to existing ServerTransportStream. There is serverTransportStreamFromContext but it's unexported.
Header sniffing ServerTransportStream may call grpc.SetHeader and e.t.c. but it seems as hacky workaround.
The text was updated successfully, but these errors were encountered:
That was transport.StreamFromContext(ctx context.Context) (s *transport.Stream, ok bool). It was right desition to remove it, because it was using transport.Stream, but not new grpc.ServerTransportStream
We can export this function, also as a temporary experimental feature, to unbreak you. Note that I intend to redesign interceptors and stats handlers (#1805) in the next month or two, because of several deficiencies in their design.
FWIW, I didn't choose to export this function in the original PR because it was not really necessary.
You can access the methods of the ServerTransportStream just using the context in which it is stored, by passing the context into grpc.SetHeader, grpc.SendHeader, and grpc.SetTrailer. The only other method, for the stream name, is indirectly accessible via grpc.MethodNameFromStream (by creating a dummygrpc.ServerStream implementation whose Context method returns the context in question).
While not ideal, it was a way to minimize the exported surface area since it's experimental.
lockbot
locked as resolved and limited conversation to collaborators
Nov 4, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Problem
Needed Header/Trailer sniffing in server interceptor. It could be done by wrapping
ServerTransportStream
and attaching it to the context usingNewContextWithServerTransportStream
. But there is no clear API access to existingServerTransportStream
. There isserverTransportStreamFromContext
but it's unexported.Header sniffing
ServerTransportStream
may callgrpc.SetHeader
and e.t.c. but it seems as hacky workaround.The text was updated successfully, but these errors were encountered: