зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
48eb012ef4
Коммит
362da7534b
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче