Skip to content

Commit

Permalink
Issue #4331 Close Complete
Browse files Browse the repository at this point in the history
invert test as we can now call complete when not ready!

Signed-off-by: Greg Wilkins <gregw@webtide.com>
  • Loading branch information
gregw committed Dec 5, 2019
1 parent 88398c8 commit cfc63a9
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -243,8 +243,8 @@ public void onWritePossible() throws IOException
// The write is too large and will stall.
output.write(ByteBuffer.wrap(new byte[2 * clientWindow]));

// We cannot call complete() now before checking for isReady().
// This will abort the response and the client will receive a reset.
// We can now call complete() now before checking for isReady().
// This will asynchronously complete when the write is finished.
asyncContext.complete();
}

Expand Down Expand Up @@ -275,10 +275,15 @@ public Map<Integer, Integer> onPreface(Session session)
session.newStream(frame, promise, new Stream.Listener.Adapter()
{
@Override
public void onReset(Stream stream, ResetFrame frame)
public void onClosed(Stream stream)
{
latch.countDown();
}

@Override
public void onReset(Stream stream, ResetFrame frame)
{
}
});
assertTrue(latch.await(5, TimeUnit.SECONDS));
}
Expand Down

0 comments on commit cfc63a9

Please sign in to comment.