[rhythmbox] daap: properly handle password-protected shares; req. libdmapsharing 2.9.9+ (bug #501389) Signed-off



commit 2305ce47ad13c00979109192dbd34780b5bd944e
Author: W. Michael Petullo <mike flyn org>
Date:   Tue May 17 09:40:28 2011 -0500

    daap: properly handle password-protected shares; req. libdmapsharing 2.9.9+ (bug #501389)
    Signed-off-by: W. Michael Petullo <mike flyn org>

 configure.ac                  |    2 +-
 plugins/daap/rb-daap-source.c |   25 +++++++++++++++----------
 2 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 124b1a2..5a82ab4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -728,7 +728,7 @@ AC_ARG_ENABLE(daap,
                              [Disable DAAP support]),,
               enable_daap=auto)
 if test "x$enable_daap" != "xno"; then
-	PKG_CHECK_MODULES(DMAPSHARING, libdmapsharing-3.0,
+	PKG_CHECK_MODULES(DMAPSHARING, libdmapsharing-3.0 >= 2.9.9,
 			  have_libdmapsharing=yes,
 			  have_libdmapsharing=no)
 	if test "x$have_libdmapsharing" = "xno" -a "x$enable_daap" = "xyes"; then
diff --git a/plugins/daap/rb-daap-source.c b/plugins/daap/rb-daap-source.c
index 4e12aee..82d6b2f 100644
--- a/plugins/daap/rb-daap-source.c
+++ b/plugins/daap/rb-daap-source.c
@@ -429,16 +429,24 @@ ask_password (RBDAAPSource *source, const char *name, const char *keyring)
 #endif
 	}
 
+	if (! password) {
+		rb_daap_source_disconnect (source);
+	}
+
 	return password;
 }
 
-static char *
-connection_auth_cb (DMAPConnection   *connection,
-		    const char       *name,
-		    RBDAAPSource     *source)
+static void
+connection_auth_cb (DMAPConnection *connection,
+                    const char     *name,
+                    SoupSession    *session,
+                    SoupMessage    *msg,
+                    SoupAuth       *auth,
+                    gboolean        retrying,
+		    RBDAAPSource   *source)
 {
-#ifdef WITH_GNOME_KEYRING
 	gchar *password = NULL;
+#ifdef WITH_GNOME_KEYRING
 	GnomeKeyringResult keyringret;
 	gchar *keyring;
 	GList *list;
@@ -473,11 +481,10 @@ connection_auth_cb (DMAPConnection   *connection,
 	if (list)
 		gnome_keyring_network_password_list_free (list); */
 	g_free (keyring);
-	return password;
 #else
-	return ask_password (source, name, NULL);
+	password = ask_password (source, name, NULL);
 #endif
-
+	dmap_connection_authenticate_message (connection, session, msg, auth, password);
 }
 
 static void
@@ -494,7 +501,6 @@ connection_connecting_cb (DMAPConnection       *connection,
 
 	switch (state) {
 	case DMAP_GET_INFO:
-	case DMAP_GET_PASSWORD:
 	case DMAP_LOGIN:
 		source->priv->connection_status = _("Connecting to music share");
 		break;
@@ -656,7 +662,6 @@ rb_daap_source_selected (RBDisplayPage *page)
 	daap_source->priv->connection = daap_connection_new (name,
 							     daap_source->priv->host,
 							     daap_source->priv->port,
-							     daap_source->priv->password_protected,
 							     db,
 							     factory);
 	g_object_unref (entry_type);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]