|
Lines 1131-1163
Http2Session::CleanupStream(Http2Stream *aStream, nsresult aResult,
|
Link Here
|
---|
|
1131 |
{ |
1131 |
{ |
1132 |
MOZ_ASSERT(OnSocketThread(), "not on socket thread"); |
1132 |
MOZ_ASSERT(OnSocketThread(), "not on socket thread"); |
1133 |
LOG3(("Http2Session::CleanupStream %p %p 0x%X %" PRIX32 "\n", |
1133 |
LOG3(("Http2Session::CleanupStream %p %p 0x%X %" PRIX32 "\n", |
1134 |
this, aStream, aStream ? aStream->StreamID() : 0, static_cast<uint32_t>(aResult))); |
1134 |
this, aStream, aStream ? aStream->StreamID() : 0, static_cast<uint32_t>(aResult))); |
1135 |
if (!aStream) { |
1135 |
if (!aStream) { |
1136 |
return; |
1136 |
return; |
1137 |
} |
1137 |
} |
1138 |
|
1138 |
|
1139 |
if (aStream->DeferCleanup(aResult)) { |
|
|
1140 |
LOG3(("Http2Session::CleanupStream 0x%X deferred\n", aStream->StreamID())); |
1141 |
return; |
1142 |
} |
1143 |
|
1144 |
if (!VerifyStream(aStream)) { |
1145 |
LOG3(("Http2Session::CleanupStream failed to verify stream\n")); |
1146 |
return; |
1147 |
} |
1148 |
|
1149 |
Http2PushedStream *pushSource = aStream->PushSource(); |
1139 |
Http2PushedStream *pushSource = aStream->PushSource(); |
1150 |
if (pushSource) { |
1140 |
if (pushSource) { |
1151 |
// aStream is a synthetic attached to an even push |
1141 |
// aStream is a synthetic attached to an even push |
1152 |
MOZ_ASSERT(pushSource->GetConsumerStream() == aStream); |
1142 |
MOZ_ASSERT(pushSource->GetConsumerStream() == aStream); |
1153 |
MOZ_ASSERT(!aStream->StreamID()); |
1143 |
MOZ_ASSERT(!aStream->StreamID()); |
1154 |
MOZ_ASSERT(!(pushSource->StreamID() & 0x1)); |
1144 |
MOZ_ASSERT(!(pushSource->StreamID() & 0x1)); |
1155 |
pushSource->SetConsumerStream(nullptr); |
1145 |
aStream->ClearPushSource(); |
|
|
1146 |
} |
1147 |
|
1148 |
if (aStream->DeferCleanup(aResult)) { |
1149 |
LOG3(("Http2Session::CleanupStream 0x%X deferred\n", aStream->StreamID())); |
1150 |
return; |
1151 |
} |
1152 |
|
1153 |
if (!VerifyStream(aStream)) { |
1154 |
LOG3(("Http2Session::CleanupStream failed to verify stream\n")); |
1155 |
return; |
1156 |
} |
1156 |
} |
1157 |
|
1157 |
|
1158 |
// don't reset a stream that has recevied a fin or rst |
1158 |
// don't reset a stream that has recevied a fin or rst |
1159 |
if (!aStream->RecvdFin() && !aStream->RecvdReset() && aStream->StreamID() && |
1159 |
if (!aStream->RecvdFin() && !aStream->RecvdReset() && aStream->StreamID() && |
1160 |
!(mInputFrameFinal && (aStream == mInputFrameDataStream))) { // !(recvdfin with mark pending) |
1160 |
!(mInputFrameFinal && (aStream == mInputFrameDataStream))) { // !(recvdfin with mark pending) |
1161 |
LOG3(("Stream 0x%X had not processed recv FIN, sending RST code %X\n", aStream->StreamID(), aResetCode)); |
1161 |
LOG3(("Stream 0x%X had not processed recv FIN, sending RST code %X\n", aStream->StreamID(), aResetCode)); |
1162 |
GenerateRstStream(aResetCode, aStream->StreamID()); |
1162 |
GenerateRstStream(aResetCode, aStream->StreamID()); |
1163 |
} |
1163 |
} |