Skip to content

Commit

Permalink
fruity: invalidate closed lockdown_client
Browse files Browse the repository at this point in the history
  • Loading branch information
hsorbo committed Jul 29, 2024
1 parent 3c8221d commit cf3aa58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion releng
3 changes: 2 additions & 1 deletion src/fruity/device-monitor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,14 @@ namespace Frida.Fruity {
private async void process_usbmux_lockdown_service_requests () {
UsbmuxLockdownServiceRequest? req;
while ((req = usbmux_lockdown_service_requests.peek ()) != null) {
bool using_cache = cached_usbmux_lockdown_client != null;
try {
if (cached_usbmux_lockdown_client == null)
cached_usbmux_lockdown_client = yield open_usbmux_lockdown_client (req.cancellable);
var stream = yield cached_usbmux_lockdown_client.start_service (req.service_name, req.cancellable);
req.promise.resolve (stream);
} catch (GLib.Error e) {
if (e is Error.TRANSPORT && cached_usbmux_lockdown_client != null) {
if ((e is Error.TRANSPORT && cached_usbmux_lockdown_client != null) || (e is LockdownError.PROTOCOL && using_cache)) {
cached_usbmux_lockdown_client = null;
continue;
}
Expand Down

0 comments on commit cf3aa58

Please sign in to comment.