diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-02-19 12:45:10 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-02-19 12:45:10 +0100 |
commit | ed2b32c6829ad6ed9310f2f76047a6dc2e12d9dd (patch) | |
tree | 6cc1424d3c34a06c231dd239c3a2f5cef2410d98 /src | |
parent | 1a11af0f86cee0ca24861a8369782627906363d1 (diff) |
plugin-manager: if minimum time consumed and all deferred tasks, abort probing
For the case where we just get a device with all net ports (i.e. all deferred
until result suggested), just abort the probing if the minimum probing time is
consumed.
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-plugin-manager.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c index 82c784a2..940990e3 100644 --- a/src/mm-plugin-manager.c +++ b/src/mm-plugin-manager.c @@ -561,8 +561,29 @@ min_probing_timeout_cb (FindDeviceSupportContext *ctx) /* If there are no running probes around, we're free to finish */ if (ctx->running_probes == NULL) { - mm_dbg ("(Plugin Manager) Minimum probing time consumed and no more ports to probe"); + mm_dbg ("(Plugin Manager) [%s] Minimum probing time consumed and no more ports to probe", + mm_device_get_path (ctx->device)); find_device_support_context_complete_and_free (ctx); + } else { + GList *l; + gboolean not_deferred = FALSE; + + mm_dbg ("(Plugin Manager) [%s] Minimum probing time consumed", + mm_device_get_path (ctx->device)); + + /* If all we got were probes with 'deferred_until_suggested', just cancel + * the probing. May happen e.g. with just 'net' ports */ + for (l = ctx->running_probes; l; l = g_list_next (l)) { + PortProbeContext *port_probe_ctx = l->data; + + if (!port_probe_ctx->defer_until_suggested) { + not_deferred = TRUE; + break; + } + } + + if (!not_deferred) + suggest_port_probe_result (ctx, NULL, NULL); } return FALSE; |