1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Fill more connection information in one spot

This commit is contained in:
Will Storey 2019-10-12 15:46:09 -07:00
parent 1639425217
commit 34effcec01
2 changed files with 10 additions and 12 deletions

View File

@ -151,10 +151,6 @@ static int server_reconnect_timeout(void)
static void sserver_connect(SERVER_SETUP_REC *rec, SERVER_CONNECT_REC *conn)
{
conn->family = rec->family;
conn->address = g_strdup(rec->address);
if (conn->port == 0) conn->port = rec->port;
server_setup_fill_reconn(conn, rec);
server_reconnect_add(conn, rec->last_connect+reconnect_time);
server_connect_unref(conn);

View File

@ -108,6 +108,16 @@ void server_setup_fill_reconn(SERVER_CONNECT_REC *conn,
if (sserver->password != NULL && conn->password == NULL)
conn->password = g_strdup(sserver->password);
if (sserver->no_proxy)
g_free_and_null(conn->proxy);
if (sserver->family != 0 && conn->family == 0)
conn->family = sserver->family;
if (sserver->address && !conn->address)
conn->address = g_strdup(sserver->address);
if (sserver->port > 0 && conn->port <= 0)
conn->port = sserver->port;
conn->use_tls = sserver->use_tls;
if (conn->tls_cert == NULL && sserver->tls_cert != NULL && sserver->tls_cert[0] != '\0')
conn->tls_cert = g_strdup(sserver->tls_cert);
@ -178,14 +188,6 @@ static void server_setup_fill_server(SERVER_CONNECT_REC *conn,
sserver->last_connect = time(NULL);
if (sserver->no_proxy)
g_free_and_null(conn->proxy);
if (sserver->family != 0 && conn->family == 0)
conn->family = sserver->family;
if (sserver->port > 0 && conn->port <= 0)
conn->port = sserver->port;
server_setup_fill_reconn(conn, sserver);
signal_emit("server setup fill server", 2, conn, sserver);