summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86683aa)
raw | patch | inline | side by side (parent: 86683aa)
author | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 21:18:02 +0000 (23:18 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 21:18:02 +0000 (23:18 +0200) |
Abort the connection when the configured password fails.
src/mpdclient.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 5e138edca16b085a6fc60ab78add92fd04dd7cca..77638d65c7b5691d4190200989dafc8d5bdcf5eb 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
gfloat _timeout,
const gchar *password)
{
- gint retval = 0;
-
/* close any open connection */
if( c->connection )
mpdclient_disconnect(c);
}
/* send password */
- if( password ) {
- mpd_send_password(c->connection, password);
- retval = mpdclient_finish_command(c);
+ if (password != NULL && !mpd_run_password(c->connection, password)) {
+ mpdclient_handle_error(c);
+ mpdclient_disconnect(c);
+ return false;
}
return true;