RE: [PATCH] service: Fix connection logic when called from D-Bus
Hi, root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk net.connman.Error.Failed: Input/Output Error There is actually an error yes, I could reproduce it easily. The loop should ignore the same service. But fix is a bit overkill, just do this: if (service == temp) continue; That should do the trick, at the beginning of the loop. Thanks Tomasz, I think ConnMan can check the service state whether it is connecting or connected when entered the function connect_service. I will send a new patch for this issue, please review. Thanks, Chengyi ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
RE: [PATCH] service: Fix connection logic when called from D-Bus
Hi, From: Chengyi Zhao chengyi1.z...@archermind.com When reconnected a same service which it has already been either connected or connecting before, this service doesn't need to be disconnected. --- src/service.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/service.c b/src/service.c index 9406bc3..2421215 100644 --- a/src/service.c +++ b/src/service.c @@ -3968,6 +3968,9 @@ static DBusMessage *connect_service(DBusConnection *conn, if (!is_connecting(temp) !is_connected(temp)) break; + if (g_strcmp0(service-path, temp-path) == 0) + break; + I'd like to explain why committed this path. Do the following operations before applying this patch: root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk net.connman.Error.Failed: Input/Output Error I think this is a issue that user gets the IO error and network will be diconnected when reconnected the same service. Do the following operations after applying this patch: root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk net.connman.Error.AlreadyConnected: Already connected Perhaps the better patch will fix this issue, please check. Thanks, Chengyi ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman
Re: [PATCH] service: Fix connection logic when called from D-Bus
Hi, root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk root:/usr/lib/connman/test ./test-connman connect wifi_00dbdf140abe_54502d4c494e4b5f343736383741_managed_psk net.connman.Error.Failed: Input/Output Error There is actually an error yes, I could reproduce it easily. The loop should ignore the same service. But fix is a bit overkill, just do this: if (service == temp) continue; That should do the trick, at the beginning of the loop. @Patrik: do you confirm this? Tomasz ___ connman mailing list connman@connman.net https://lists.connman.net/mailman/listinfo/connman