bluez5: don't try to acquire if we are getting errors

If transport goes into error state too often, fail instead of trying to
acquire it again.

This avoids getting into a tight acquire->fail->reacquire loop.
This commit is contained in:
Pauli Virtanen 2023-03-18 14:48:16 +02:00
parent 397059017b
commit 13a9964a71
3 changed files with 41 additions and 8 deletions

View file

@ -1672,12 +1672,15 @@ static void transport_state_changed(void *data,
* the transport, we won't get a write error, but instead see a transport
* state change.
*
* Emit a node error, to let upper levels handle it.
* Treat this as a transport error, so that upper levels don't try to
* retry too often.
*/
spa_log_debug(this->log, "%p: transport %p becomes inactive: stop and indicate error",
this, this->transport);
state = SPA_BT_TRANSPORT_STATE_ERROR;
spa_bt_transport_set_state(this->transport, SPA_BT_TRANSPORT_STATE_ERROR);
return;
}
if (state == SPA_BT_TRANSPORT_STATE_ERROR) {