Code

struct mpdclient: add a reconnection count
[ncmpc.git] / src / mpdclient.c
index ec058061546c23cf1033076d220b267745ff2949..685d149a3cb5004dbff5d0ad02e66cd022f86c11 100644 (file)
@@ -115,8 +115,10 @@ mpdclient_disconnect(struct mpdclient *c)
                c->idle = false;
        }
 
-       if (c->connection)
+       if (c->connection) {
                mpd_connection_free(c->connection);
+               ++c->connection_id;
+       }
        c->connection = NULL;
 
        if (c->status)
@@ -161,6 +163,8 @@ mpdclient_connect(struct mpdclient *c,
                return false;
        }
 
+       ++c->connection_id;
+
        return true;
 }