Fix connecting to addresses besides IPv4

This commit is contained in:
Pierre Pronchery 2016-03-30 19:00:57 +02:00
parent 6852e70275
commit 68b2a8b08c
2 changed files with 4 additions and 2 deletions

View File

@ -1206,7 +1206,8 @@ static gboolean _on_connect(gpointer data)
return FALSE;
}
/* create the socket */
if((imap4->fd = socket(ai->ai_family, ai->ai_socktype, 0)) == -1)
if((imap4->fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol))
== -1)
{
helper->error(helper->account, strerror(errno), 1);
_imap4_stop(imap4);

View File

@ -666,7 +666,8 @@ static gboolean _on_connect(gpointer data)
return FALSE;
}
/* create the socket */
if((pop3->fd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
if((pop3->fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol))
== -1)
{
helper->error(helper->account, strerror(errno), 1);
_pop3_stop(pop3);