Diff between 670354f2fc1356d948066358912c4b05ef5204e4 and c60d08b37068289303168cccfe79789348e44bc4

Changed Files

File Additions Deletions Status
src/device.c +10 -2 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index d28adeb..89ab24a 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1944,10 +1944,18 @@ static gboolean attrib_disconnected_cb(GIOChannel *io, GIOCondition cond,
 
 	g_slist_foreach(device->attios, attio_disconnected, NULL);
 
-	if (device->auto_connect == FALSE || err != ETIMEDOUT)
+	if (device->auto_connect == FALSE) {
+		DBG("Automatic connection disabled");
 		goto done;
+	}
 
-	adapter_connect_list_add(device_get_adapter(device), device);
+	/*
+	 * Keep scanning/re-connection active if disconnection reason
+	 * is connection timeout, remote user terminated connection or local
+	 * initiated disconnection.
+	 */
+	if (err == ETIMEDOUT || err == ECONNRESET || err == ECONNABORTED)
+		adapter_connect_list_add(device_get_adapter(device), device);
 
 done:
 	attio_cleanup(device);