Issue 5310 - Review HTTP/2 GOAWAY handling.
Refactored push code in a single place: HTTP2Session.push(). Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
0dc2894002
commit
206050df7f
|
@ -624,7 +624,17 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
|||
@Override
|
||||
public void push(IStream stream, Promise<Stream> promise, PushPromiseFrame frame, Stream.Listener listener)
|
||||
{
|
||||
streamCreator.push(frame, promise, listener);
|
||||
streamCreator.push(frame, new Promise.Wrapper<Stream>(promise)
|
||||
{
|
||||
@Override
|
||||
public void succeeded(Stream pushedStream)
|
||||
{
|
||||
// Pushed streams are implicitly remotely closed.
|
||||
// They are closed when sending an end-stream DATA frame.
|
||||
((IStream)pushedStream).updateClose(true, CloseState.Event.RECEIVED);
|
||||
super.succeeded(pushedStream);
|
||||
}
|
||||
}, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1338,13 +1348,6 @@ public abstract class HTTP2Session extends ContainerLifeCycle implements ISessio
|
|||
removeStream(stream);
|
||||
break;
|
||||
}
|
||||
case PUSH_PROMISE:
|
||||
{
|
||||
// Pushed streams are implicitly remotely closed.
|
||||
// They are closed when sending an end-stream DATA frame.
|
||||
stream.updateClose(true, CloseState.Event.RECEIVED);
|
||||
break;
|
||||
}
|
||||
case GO_AWAY:
|
||||
{
|
||||
// We just sent a GO_AWAY, only shutdown the
|
||||
|
|
Loading…
Reference in New Issue