bug 758725 spdy act on fin on synreply r=honzab

This commit is contained in:
Patrick McManus 2012-05-25 17:18:41 -04:00
Родитель a79b4c376a
Коммит c1096ca2e1
2 изменённых файлов: 16 добавлений и 9 удалений

Просмотреть файл

@ -1984,15 +1984,8 @@ SpdySession::OnWriteSegment(char *buf,
if (mInputFrameDataLast &&
mInputFrameDataRead == mInputFrameDataSize) {
// This will result in Close() being called
NS_ABORT_IF_FALSE(!mNeedsCleanup, "mNeedsCleanup unexpectedly set");
mNeedsCleanup = mInputFrameDataStream;
LOG3(("SpdySession::OnWriteSegment %p - recorded downstream fin of "
"stream %p 0x%X", this, mInputFrameDataStream,
mInputFrameDataStream->StreamID()));
*countWritten = 0;
ResetDownstreamState();
SetNeedsCleanup();
return NS_BASE_STREAM_CLOSED;
}
@ -2018,7 +2011,7 @@ SpdySession::OnWriteSegment(char *buf,
if (mFlatHTTPResponseHeaders.Length() == mFlatHTTPResponseHeadersOut &&
mInputFrameDataLast) {
*countWritten = 0;
ResetDownstreamState();
SetNeedsCleanup();
return NS_BASE_STREAM_CLOSED;
}
@ -2040,6 +2033,19 @@ SpdySession::OnWriteSegment(char *buf,
return NS_ERROR_UNEXPECTED;
}
void
SpdySession::SetNeedsCleanup()
{
LOG3(("SpdySession::SetNeedsCleanup %p - recorded downstream fin of "
"stream %p 0x%X", this, mInputFrameDataStream,
mInputFrameDataStream->StreamID()));
// This will result in Close() being called
NS_ABORT_IF_FALSE(!mNeedsCleanup, "mNeedsCleanup unexpectedly set");
mNeedsCleanup = mInputFrameDataStream;
ResetDownstreamState();
}
//-----------------------------------------------------------------------------
// Modified methods of nsAHttpConnection
//-----------------------------------------------------------------------------

Просмотреть файл

@ -191,6 +191,7 @@ private:
void ProcessPending();
nsresult SetInputFrameDataStream(PRUint32);
bool VerifyStream(SpdyStream *, PRUint32);
void SetNeedsCleanup();
// a wrapper for all calls to the nshttpconnection level segment writer. Used
// to track network I/O for timeout purposes