diff --git a/linphone/coreapi/authentication.c b/linphone/coreapi/authentication.c
index e84d2c306..a8c8c3a9c 100644
--- a/linphone/coreapi/authentication.c
+++ b/linphone/coreapi/authentication.c
@@ -187,19 +187,26 @@ LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const char *rea
return ret;
}
+static void refresh_exosip_auth_info(LinphoneCore *lc){
+ MSList *elem;
+ eXosip_lock();
+ eXosip_clear_authentication_info();
+ for (elem=lc->auth_info;elem!=NULL;elem=ms_list_next(elem)){
+ LinphoneAuthInfo *info=(LinphoneAuthInfo*)elem->data;
+ char *userid;
+ if (info->userid==NULL || info->userid[0]=='\0') userid=info->username;
+ else userid=info->userid;
+ eXosip_add_authentication_info(info->username,userid,
+ info->passwd,info->ha1,info->realm);
+ }
+ eXosip_unlock();
+}
+
void linphone_core_add_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info)
{
MSList *elem;
- char *userid;
LinphoneAuthInfo *ai;
- if (info->userid==NULL || info->userid[0]=='\0') userid=info->username;
- else userid=info->userid;
- eXosip_lock();
- eXosip_add_authentication_info(info->username,userid,
- info->passwd,info->ha1,info->realm);
- eXosip_unlock();
- /* if the user was prompted, re-allow automatic_action */
- if (lc->automatic_action>0) lc->automatic_action--;
+
/* find if we are attempting to modify an existing auth info */
ai=linphone_core_find_auth_info(lc,info->realm,info->username);
if (ai!=NULL){
@@ -213,6 +220,9 @@ void linphone_core_add_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info)
}else {
lc->auth_info=ms_list_append(lc->auth_info,(void *)info);
}
+ refresh_exosip_auth_info(lc);
+ /* if the user was prompted, re-allow automatic_action */
+ if (lc->automatic_action>0) lc->automatic_action--;
}
void linphone_core_abort_authentication(LinphoneCore *lc, LinphoneAuthInfo *info){
@@ -234,6 +244,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info){
for (elem=lc->auth_info,i=0;elem!=NULL;elem=ms_list_next(elem),i++){
linphone_auth_info_write_config(lc->config,(LinphoneAuthInfo*)elem->data,i);
}
+ refresh_exosip_auth_info(lc);
}
diff --git a/linphone/coreapi/siplogin.c b/linphone/coreapi/siplogin.c
index 78455ae86..0b6cb43cb 100644
--- a/linphone/coreapi/siplogin.c
+++ b/linphone/coreapi/siplogin.c
@@ -60,7 +60,10 @@ static int sip_login_do_login(SipSetupContext * ctx, const char *uri, const char
char *tmp;
osip_from_init(&parsed_uri);
- osip_from_parse(parsed_uri,uri);
+ if (osip_from_parse(parsed_uri,uri)==-1){
+ osip_from_free(parsed_uri);
+ return -1;
+ }
if (parsed_uri->displayname==NULL || strlen(parsed_uri->displayname)==0){
guess_display_name(parsed_uri);
}
diff --git a/linphone/gtk-glade/loginframe.c b/linphone/gtk-glade/loginframe.c
index 7a46fb7af..898d8a823 100644
--- a/linphone/gtk-glade/loginframe.c
+++ b/linphone/gtk-glade/loginframe.c
@@ -136,6 +136,9 @@ void linphone_gtk_login_frame_connect_clicked(GtkWidget *button){
username=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_username")));
password=gtk_entry_get_text(GTK_ENTRY(linphone_gtk_get_widget(mw,"login_password")));
+ if (username==NULL || username[0]=='\0')
+ return;
+
autologin=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(mw,"automatic_login")));
linphone_gtk_set_ui_config_int("automatic_login",autologin);
diff --git a/linphone/gtk-glade/main.c b/linphone/gtk-glade/main.c
index 0e85fe32b..25374370f 100644
--- a/linphone/gtk-glade/main.c
+++ b/linphone/gtk-glade/main.c
@@ -782,6 +782,14 @@ static void linphone_gtk_auth_info_requested(LinphoneCore *lc, const char *realm
GtkWidget *label=linphone_gtk_get_widget(w,"message");
LinphoneAuthInfo *info;
gchar *msg;
+ GtkWidget *mw=linphone_gtk_get_main_window();
+
+ if (mw && GTK_WIDGET_VISIBLE(linphone_gtk_get_widget(mw,"login_frame"))){
+ /*don't prompt for authentication when login frame is visible*/
+ linphone_core_abort_authentication(lc,NULL);
+ return;
+ }
+
msg=g_strdup_printf(_("Please enter your password for username %s\n at domain %s:"),
username,realm);
gtk_label_set_markup(GTK_LABEL(label),msg);