summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-19 14:43:16 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-19 14:43:16 +0000
commit6f7485b8fa6888d137243742cb31fa0848abe3ba (patch)
treefc8ad5d0a1df7d353ed70507a0cdced76696f84e /src/irc
parent7437bbea5fa8025374b4b127d4a6e4e67d75ab94 (diff)
downloadirssi-6f7485b8fa6888d137243742cb31fa0848abe3ba.zip
net_connect*() contains now error parameter, so it can be used to properly
check the errno if connect() fails. Added support for connecting to named UNIX sockets. Some cleanups with session handling / server connecting as well. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2819 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-channels.c6
-rw-r--r--src/irc/core/irc-servers.c19
-rw-r--r--src/irc/dcc/dcc.c2
3 files changed, 10 insertions, 17 deletions
diff --git a/src/irc/core/irc-channels.c b/src/irc/core/irc-channels.c
index 5adf5fb1..b4ec55a2 100644
--- a/src/irc/core/irc-channels.c
+++ b/src/irc/core/irc-channels.c
@@ -160,7 +160,7 @@ static CHANNEL_REC *irc_channel_find_server(SERVER_REC *server,
return NULL;
}
-static void sig_server_looking(SERVER_REC *server)
+static void sig_server_connected(SERVER_REC *server)
{
if (!IS_IRC_SERVER(server))
return;
@@ -198,7 +198,7 @@ static void sig_channel_destroyed(IRC_CHANNEL_REC *channel)
void irc_channels_init(void)
{
- signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
+ signal_add_first("server connected", (SIGNAL_FUNC) sig_server_connected);
signal_add("channel created", (SIGNAL_FUNC) sig_channel_created);
signal_add("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
@@ -216,7 +216,7 @@ void irc_channels_init(void)
void irc_channels_deinit(void)
{
- signal_remove("server looking", (SIGNAL_FUNC) sig_server_looking);
+ signal_remove("server connected", (SIGNAL_FUNC) sig_server_connected);
signal_remove("channel created", (SIGNAL_FUNC) sig_channel_created);
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c
index 0a198e48..e294f9fc 100644
--- a/src/irc/core/irc-servers.c
+++ b/src/irc/core/irc-servers.c
@@ -87,16 +87,6 @@ static void send_message(SERVER_REC *server, const char *target,
g_free(str);
}
-static void sig_server_looking(IRC_SERVER_REC *server)
-{
- if (!IS_IRC_SERVER(server))
- return;
-
- server->isnickflag = isnickflag_func;
- server->ischannel = ischannel_func;
- server->send_message = send_message;
-}
-
static void server_init(IRC_SERVER_REC *server)
{
IRC_SERVER_CONNECT_REC *conn;
@@ -256,7 +246,12 @@ static void sig_connected(IRC_SERVER_REC *server)
if (!IS_IRC_SERVER(server))
return;
- server->splits = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal);
+ server->isnickflag = isnickflag_func;
+ server->ischannel = ischannel_func;
+ server->send_message = send_message;
+
+ server->splits = g_hash_table_new((GHashFunc) g_istr_hash,
+ (GCompareFunc) g_istr_equal);
if (!server->session_reconnect)
server_init(server);
@@ -575,7 +570,6 @@ void irc_servers_init(void)
cmd_tag = g_timeout_add(500, (GSourceFunc) servers_cmd_timeout, NULL);
- signal_add_first("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_add_first("server connected", (SIGNAL_FUNC) sig_connected);
signal_add_last("server disconnected", (SIGNAL_FUNC) sig_disconnected);
signal_add_last("server quit", (SIGNAL_FUNC) sig_server_quit);
@@ -598,7 +592,6 @@ void irc_servers_deinit(void)
{
g_source_remove(cmd_tag);
- signal_remove("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_remove("server connected", (SIGNAL_FUNC) sig_connected);
signal_remove("server disconnected", (SIGNAL_FUNC) sig_disconnected);
signal_remove("server quit", (SIGNAL_FUNC) sig_server_quit);
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index 08d45ea9..b19df58b 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -247,7 +247,7 @@ GIOChannel *dcc_connect_ip(IPADDR *ip, int port)
own_ip = &temp_ip;
}
- return net_connect_ip(ip, port, own_ip);
+ return net_connect_ip(ip, port, own_ip, NULL);
}
/* Server connected - update server for DCC records that have