Properly closing the stream and eventually removing it when receiving data frames.

This commit is contained in:
Simone Bordet 2014-06-13 23:03:17 +02:00
parent d4783369bc
commit 2b86d34d5a
1 changed files with 4 additions and 1 deletions

View File

@ -119,7 +119,7 @@ public abstract class HTTP2Session implements ISession, Parser.Listener
stream.updateClose(frame.isEndStream(), false);
final int length = frame.remaining();
flowControl.onDataReceived(this, stream, length);
return stream.process(frame, new Callback.Adapter()
boolean result = stream.process(frame, new Callback.Adapter()
{
@Override
public void succeeded()
@ -127,6 +127,9 @@ public abstract class HTTP2Session implements ISession, Parser.Listener
flowControl.onDataConsumed(HTTP2Session.this, stream, length);
}
});
if (stream.isClosed())
removeStream(stream, false);
return result;
}
else
{