Bug 1137330 - Set opcode as 'PutFinal' instead of 'Put' for file header packet if file size is 0, r=shuang

This commit is contained in:
Ben Tian 2015-03-17 09:44:10 +08:00
parent 397bd2f4d5
commit 33c1f8c657
4 changed files with 16 additions and 4 deletions

View File

@ -1195,7 +1195,10 @@ BluetoothOppManager::SendPutHeaderRequest(const nsAString& aFileName,
(char*)fileName, (len + 1) * 2);
index += AppendHeaderLength(&req[index], aFileSize);
SendObexData(req, ObexRequestCode::Put, index);
// This is final put packet if file size equals to 0
uint8_t opcode = (aFileSize > 0) ? ObexRequestCode::Put
: ObexRequestCode::PutFinal;
SendObexData(req, opcode, index);
delete [] fileName;
delete [] req;

View File

@ -1161,7 +1161,10 @@ BluetoothOppManager::SendPutHeaderRequest(const nsAString& aFileName,
(char*)fileName, (len + 1) * 2);
index += AppendHeaderLength(&req[index], aFileSize);
SendObexData(req, ObexRequestCode::Put, index);
// This is final put packet if file size equals to 0
uint8_t opcode = (aFileSize > 0) ? ObexRequestCode::Put
: ObexRequestCode::PutFinal;
SendObexData(req, opcode, index);
delete [] fileName;
delete [] req;

View File

@ -1140,7 +1140,10 @@ BluetoothOppManager::SendPutHeaderRequest(const nsAString& aFileName,
(char*)fileName, (len + 1) * 2);
index += AppendHeaderLength(&req[index], aFileSize);
SendObexData(req, ObexRequestCode::Put, index);
// This is final put packet if file size equals to 0
uint8_t opcode = (aFileSize > 0) ? ObexRequestCode::Put
: ObexRequestCode::PutFinal;
SendObexData(req, opcode, index);
delete [] fileName;
delete [] req;

View File

@ -1161,7 +1161,10 @@ BluetoothOppManager::SendPutHeaderRequest(const nsAString& aFileName,
(char*)fileName, (len + 1) * 2);
index += AppendHeaderLength(&req[index], aFileSize);
SendObexData(req, ObexRequestCode::Put, index);
// This is final put packet if file size equals to 0
uint8_t opcode = (aFileSize > 0) ? ObexRequestCode::Put
: ObexRequestCode::PutFinal;
SendObexData(req, opcode, index);
delete [] fileName;
delete [] req;