|
69 | 69 | import io.netty.handler.codec.http2.Http2Error; |
70 | 70 | import io.netty.handler.codec.http2.Http2Exception; |
71 | 71 | import io.netty.handler.codec.http2.Http2Exception.StreamException; |
72 | | -import io.netty.handler.codec.http2.Http2FlowController; |
73 | 72 | import io.netty.handler.codec.http2.Http2FrameAdapter; |
74 | 73 | import io.netty.handler.codec.http2.Http2FrameLogger; |
75 | 74 | import io.netty.handler.codec.http2.Http2FrameReader; |
@@ -367,23 +366,8 @@ public void run() { |
367 | 366 | keepAliveManager.onTransportStarted(); |
368 | 367 | } |
369 | 368 |
|
370 | | - |
371 | | - if (transportTracer != null) { |
372 | | - assert encoder().connection().equals(decoder().connection()); |
373 | | - final Http2Connection connection = encoder().connection(); |
374 | | - transportTracer.setFlowControlWindowReader(new TransportTracer.FlowControlReader() { |
375 | | - private final Http2FlowController local = connection.local().flowController(); |
376 | | - private final Http2FlowController remote = connection.remote().flowController(); |
377 | | - |
378 | | - @Override |
379 | | - public TransportTracer.FlowControlWindows read() { |
380 | | - assert ctx.executor().inEventLoop(); |
381 | | - return new TransportTracer.FlowControlWindows( |
382 | | - local.windowSize(connection.connectionStream()), |
383 | | - remote.windowSize(connection.connectionStream())); |
384 | | - } |
385 | | - }); |
386 | | - } |
| 369 | + assert encoder().connection().equals(decoder().connection()); |
| 370 | + transportTracer.setFlowControlWindowReader(new Utils.FlowControlReader(encoder().connection())); |
387 | 371 |
|
388 | 372 | super.handlerAdded(ctx); |
389 | 373 | } |
@@ -895,16 +879,14 @@ public void ping() { |
895 | 879 | ChannelFuture pingFuture = encoder().writePing( |
896 | 880 | ctx, false /* isAck */, KEEPALIVE_PING, ctx.newPromise()); |
897 | 881 | ctx.flush(); |
898 | | - if (transportTracer != null) { |
899 | | - pingFuture.addListener(new ChannelFutureListener() { |
900 | | - @Override |
901 | | - public void operationComplete(ChannelFuture future) throws Exception { |
902 | | - if (future.isSuccess()) { |
903 | | - transportTracer.reportKeepAliveSent(); |
904 | | - } |
| 882 | + pingFuture.addListener(new ChannelFutureListener() { |
| 883 | + @Override |
| 884 | + public void operationComplete(ChannelFuture future) throws Exception { |
| 885 | + if (future.isSuccess()) { |
| 886 | + transportTracer.reportKeepAliveSent(); |
905 | 887 | } |
906 | | - }); |
907 | | - } |
| 888 | + } |
| 889 | + }); |
908 | 890 | } |
909 | 891 |
|
910 | 892 | @Override |
|
0 commit comments