summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd83d47)
raw | patch | inline | side by side (parent: dd83d47)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 4 Jan 2012 17:33:29 +0000 (18:33 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 23 May 2012 01:49:43 +0000 (03:49 +0200) |
src/mpdclient.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index ec058061546c23cf1033076d220b267745ff2949..685d149a3cb5004dbff5d0ad02e66cd022f86c11 100644 (file)
--- a/src/mpdclient.c
+++ b/src/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)
return false;
}
+ ++c->connection_id;
+
return true;
}
diff --git a/src/mpdclient.h b/src/mpdclient.h
index 3b02681a47e953e7d7ea077afe51bd00af1fd6e8..e9234805d6443f88692fb2c689c208cd11b28921 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
struct mpd_connection *connection;
+ /**
+ * This attribute is incremented whenever the connection changes
+ * (i.e. on disconnection and (re-)connection).
+ */
+ unsigned connection_id;
+
/**
* If this object is non-NULL, it tracks idle events. It is
* automatically called by mpdclient_get_connection() and