GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Release a SPDY DATA frame that exceeds the session window · netty/netty@f7bf4fa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • codec-http/src
    • main/java/io/netty/handler/codec/spdy
      • SpdySessionHandler.java
    • test/java/io/netty/handler/codec/spdy
      • SpdySessionHandlerTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
172172

173173
// Check if session window size is reduced beyond allowable lower bound
174174
if (newSessionWindowSize < 0) {
175+
spdyDataFrame.release();
175176
issueSessionError(ctx, SpdySessionStatus.PROTOCOL_ERROR);
176177
return;
177178
}
Collapse file

‎codec-http/src/test/java/io/netty/handler/codec/spdy/SpdySessionHandlerTest.java‎

Copy file name to clipboardExpand all lines: codec-http/src/test/java/io/netty/handler/codec/spdy/SpdySessionHandlerTest.java
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package io.netty.handler.codec.spdy;
1717

18+
import io.netty.buffer.ByteBuf;
19+
import io.netty.buffer.Unpooled;
1820
import io.netty.channel.ChannelHandlerContext;
1921
import io.netty.channel.ChannelInboundHandlerAdapter;
2022
import io.netty.channel.embedded.EmbeddedChannel;
@@ -354,6 +356,25 @@ private static void testSpdySessionHandlerCustomMaxConcurrentStreams(SpdyVersion
354356
assertTrue(sessionHandler.finishAndReleaseAll());
355357
}
356358

359+
@Test
360+
public void testDataFrameExceedingSessionWindowIsReleased() {
361+
EmbeddedChannel sessionHandler = new EmbeddedChannel(new SpdySessionHandler(SpdyVersion.SPDY_3_1, true));
362+
sessionHandler.writeInbound(new DefaultSpdySynStreamFrame(1, 0, (byte) 0));
363+
364+
// A DATA frame larger than the initial 64 KiB session window is a session error.
365+
ByteBuf content = Unpooled.buffer(70000).writeZero(70000);
366+
sessionHandler.writeInbound(new DefaultSpdyDataFrame(1, content));
367+
368+
assertEquals(0, content.refCnt());
369+
Object frame;
370+
boolean goAway = false;
371+
while ((frame = sessionHandler.readOutbound()) != null) {
372+
goAway |= frame instanceof SpdyGoAwayFrame;
373+
}
374+
assertTrue(goAway);
375+
sessionHandler.finishAndReleaseAll();
376+
}
377+
357378
@Test
358379
public void testSpdySessionHandlerRejectsNonPositiveMaxConcurrentStreams() {
359380
assertThrows(IllegalArgumentException.class,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.