mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1161003
: Don't send PDU when connection to Bluetooth daemon is closed, r=shuang
During restarts of the Bluetooth daemon, it can occur that Gecko tries to send without having a connection to bluetoothd opened. This patch adds a check to prevent this.
This commit is contained in:
parent
ba00d907df
commit
4f5dc0f157
@ -1512,6 +1512,12 @@ BluetoothDaemonProtocol::Send(BluetoothDaemonPDU* aPDU, void* aUserData)
|
||||
aPDU->SetConsumer(this);
|
||||
aPDU->SetUserData(aUserData);
|
||||
aPDU->UpdateHeader();
|
||||
|
||||
if (mConnection->GetConnectionStatus() == SOCKET_DISCONNECTED) {
|
||||
BT_LOGR("Connection to Bluetooth daemon is closed.");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
mConnection->SendSocketData(aPDU); // Forward PDU to command channel
|
||||
|
||||
return NS_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user