[vlc-devel] commit: Use dialog_Login ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat Mar 7 22:30:37 CET 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 7 22:23:10 2009 +0200| [03cb9032c0c845c89cdc21a3ce3147dfb5a138e5] | committer: Rémi Denis-Courmont
Use dialog_Login
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03cb9032c0c845c89cdc21a3ce3147dfb5a138e5
---
modules/access/http.c | 24 ++++++++++--------------
modules/demux/live555.cpp | 13 +++++--------
2 files changed, 15 insertions(+), 22 deletions(-)
diff --git a/modules/access/http.c b/modules/access/http.c
index dec0de8..4d27b83 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -37,7 +37,7 @@
#include <vlc_access.h>
-#include <vlc_interface.h>
+#include <vlc_dialog.h>
#include <vlc_meta.h>
#include <vlc_network.h>
#include <vlc_url.h>
@@ -433,8 +433,7 @@ connect:
if( p_sys->i_code == 401 )
{
- char *psz_login = NULL, *psz_password = NULL;
- char psz_msg[250];
+ char *psz_login, *psz_password;
int i_ret;
/* FIXME ? */
if( p_sys->url.psz_username && p_sys->url.psz_password &&
@@ -443,21 +442,18 @@ connect:
Disconnect( p_access );
goto connect;
}
- snprintf( psz_msg, 250,
- _("Please enter a valid login name and a password for realm %s."),
- p_sys->auth.psz_realm );
msg_Dbg( p_access, "authentication failed for realm %s",
- p_sys->auth.psz_realm );
- i_ret = intf_UserLoginPassword( p_access, _("HTTP authentication"),
- psz_msg, &psz_login, &psz_password );
- if( i_ret == DIALOG_OK_YES )
+ p_sys->auth.psz_realm );
+ dialog_Login( p_access, &psz_login, &psz_password,
+ _("HTTP authentication"),
+ _("Please enter a valid login name and a password for realm %s."),
+ p_sys->auth.psz_realm );
+ if( psz_login != NULL && psz_password != NULL )
{
msg_Dbg( p_access, "retrying with user=%s, pwd=%s",
psz_login, psz_password );
- if( psz_login ) p_sys->url.psz_username = strdup( psz_login );
- if( psz_password ) p_sys->url.psz_password = strdup( psz_password );
- free( psz_login );
- free( psz_password );
+ p_sys->url.psz_username = psz_login;
+ p_sys->url.psz_password = psz_password;
Disconnect( p_access );
goto connect;
}
diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index 00b5171..d010da5 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -42,7 +42,7 @@
#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_demux.h>
-#include <vlc_interface.h>
+#include <vlc_dialog.h>
#include <vlc_network.h>
#include <vlc_url.h>
@@ -604,17 +604,14 @@ describe:
if( i_code == 401 )
{
- int i_result;
msg_Dbg( p_demux, "authentication failed" );
free( psz_user );
free( psz_pwd );
- psz_user = psz_pwd = NULL;
-
- i_result = intf_UserLoginPassword( p_demux, _("RTSP authentication"),
- _("Please enter a valid login name and a password."),
- &psz_user, &psz_pwd );
- if( i_result == DIALOG_OK_YES )
+ dialog_Login( p_demux, &psz_user, &psz_pwd,
+ _("RTSP authentication"),
+ _("Please enter a valid login name and a password.") );
+ if( psz_user != NULL && psz_pwd != NULL )
{
msg_Dbg( p_demux, "retrying with user=%s, pwd=%s",
psz_user, psz_pwd );
More information about the vlc-devel
mailing list