mirror of https://github.com/grpc/grpc-java.git
Upgrading to latest Netty.
Fixes race condition while shutting down. ------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=80484055
This commit is contained in:
parent
f96e7e8c6c
commit
be29ba57cc
|
|
@ -117,7 +117,7 @@ class NettyClientHandler extends Http2ConnectionHandler {
|
|||
void returnProcessedBytes(int streamId, int bytes) {
|
||||
try {
|
||||
Http2Stream http2Stream = connection().requireStream(streamId);
|
||||
http2Stream.inboundFlow().returnProcessedBytes(ctx, bytes);
|
||||
http2Stream.garbageCollector().returnProcessedBytes(ctx, bytes);
|
||||
} catch (Http2Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
@ -334,7 +334,7 @@ class NettyClientHandler extends Http2ConnectionHandler {
|
|||
throws Http2Exception {
|
||||
// Attach the client stream to the HTTP/2 stream object as user data.
|
||||
Http2Stream http2Stream = connection().requireStream(streamId);
|
||||
http2Stream.data(stream);
|
||||
http2Stream.setProperty(NettyClientStream.class, stream);
|
||||
|
||||
// Notify the stream that it has been created.
|
||||
stream.id(streamId);
|
||||
|
|
@ -345,7 +345,7 @@ class NettyClientHandler extends Http2ConnectionHandler {
|
|||
* Gets the client stream associated to the given HTTP/2 stream object.
|
||||
*/
|
||||
private NettyClientStream clientStream(Http2Stream stream) {
|
||||
return stream.<NettyClientStream>data();
|
||||
return stream.getProperty(NettyClientStream.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class NettyServerHandler extends Http2ConnectionHandler {
|
|||
// The Http2Stream object was put by AbstractHttp2ConnectionHandler before calling this
|
||||
// method.
|
||||
Http2Stream http2Stream = connection().requireStream(streamId);
|
||||
http2Stream.data(stream);
|
||||
http2Stream.setProperty(NettyServerStream.class, stream);
|
||||
String method = determineMethod(streamId, headers);
|
||||
ServerStreamListener listener =
|
||||
transportListener.streamCreated(stream, method, Utils.convertHeaders(headers));
|
||||
|
|
@ -198,7 +198,7 @@ class NettyServerHandler extends Http2ConnectionHandler {
|
|||
void returnProcessedBytes(int streamId, int bytes) {
|
||||
try {
|
||||
Http2Stream http2Stream = connection().requireStream(streamId);
|
||||
http2Stream.inboundFlow().returnProcessedBytes(ctx, bytes);
|
||||
http2Stream.garbageCollector().returnProcessedBytes(ctx, bytes);
|
||||
} catch (Http2Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ class NettyServerHandler extends Http2ConnectionHandler {
|
|||
* Returns the server stream associated to the given HTTP/2 stream object
|
||||
*/
|
||||
private NettyServerStream serverStream(Http2Stream stream) {
|
||||
return stream.<NettyServerStream>data();
|
||||
return stream.getProperty(NettyServerStream.class);
|
||||
}
|
||||
|
||||
private Http2StreamException newStreamException(int streamId, Throwable cause) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue