summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51efef6)
raw | patch | inline | side by side (parent: 51efef6)
author | Max Kellermann <max.kellermann@gmail.com> | |
Sun, 19 Mar 2017 12:02:11 +0000 (13:02 +0100) | ||
committer | Max Kellermann <max.kellermann@gmail.com> | |
Sun, 19 Mar 2017 12:02:11 +0000 (13:02 +0100) |
Invoke the error callback, but don't attempt to recover.
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 1a059d517e1a3571a66c7c193b2c108bf8695bb7..6e6dd9948f6fa218e261246c7510ead26adac537 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
g_free(allocated);
}
+static void
+mpdclient_invoke_error_callback1(struct mpdclient *c)
+{
+ assert(c != NULL);
+ assert(c->connection != NULL);
+
+ struct mpd_connection *connection = c->connection;
+
+ enum mpd_error error = mpd_connection_get_error(connection);
+ assert(error != MPD_ERROR_SUCCESS);
+
+ mpdclient_invoke_error_callback(error,
+ mpd_connection_get_error_message(connection));
+}
+
static void
mpdclient_gidle_callback(enum mpd_error error,
gcc_unused enum mpd_server_error server_error,
g_error("Out of memory");
if (mpd_connection_get_error(c->connection) != MPD_ERROR_SUCCESS) {
- mpdclient_handle_error(c);
+ mpdclient_invoke_error_callback1(c);
mpdclient_disconnect(c);
mpdclient_failed_callback();
return false;
/* send password */
if (c->password != NULL &&
!mpd_run_password(c->connection, c->password)) {
- mpdclient_handle_error(c);
+ mpdclient_invoke_error_callback1(c);
mpdclient_disconnect(c);
mpdclient_failed_callback();
return false;