Bug 871438 - Reset value when file transfer session starts, r=gyeh

When the transferring session was stopped, mBodySegmentLength wouldn't reset
to 0, and that would impact the next transferring if the first packet of the
next transferring doesn't contain header Body or EndOfBody, which would invoke
ExtractPacketHeaders() and refresh mBodySegmentLength in the function.
This commit is contained in:
Eric Chou 2013-05-28 15:25:42 +08:00
parent 235a433fa5
commit 4d7f9db013

View File

@ -439,6 +439,7 @@ BluetoothOppManager::AfterFirstPut()
sSentFileLength = 0;
sWaitingToSendPutFinal = false;
mSuccessFlag = false;
mBodySegmentLength = 0;
}
void
@ -771,7 +772,7 @@ BluetoothOppManager::ServerDataHandler(UnixSocketRawData* aMessage)
// When we cancel the transfer, delete the file and notify complemention
if (mAbortFlag) {
ReplyToPut(mPutFinalFlag, !mAbortFlag);
ReplyToPut(mPutFinalFlag, false);
sSentFileLength += mBodySegmentLength;
DeleteReceivedFile();
FileTransferComplete();