diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/chat-commands.c | 2 | ||||
-rw-r--r-- | src/core/commands.h | 2 | ||||
-rw-r--r-- | src/core/expandos.c | 22 | ||||
-rw-r--r-- | src/core/log.c | 20 | ||||
-rw-r--r-- | src/core/net-nonblock.h | 2 | ||||
-rw-r--r-- | src/core/net-sendbuffer.c | 2 | ||||
-rw-r--r-- | src/core/net-sendbuffer.h | 2 | ||||
-rw-r--r-- | src/core/network-openssl.c | 2 | ||||
-rw-r--r-- | src/core/network.c | 2 | ||||
-rw-r--r-- | src/core/nicklist.c | 2 | ||||
-rw-r--r-- | src/core/query-rec.h | 2 | ||||
-rw-r--r-- | src/core/servers-reconnect.c | 3 | ||||
-rw-r--r-- | src/core/servers-setup.c | 3 | ||||
-rw-r--r-- | src/core/servers.c | 4 |
14 files changed, 42 insertions, 28 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index 235a9fc4..8d1ac3eb 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -321,7 +321,7 @@ static void cmd_quit(const char *data) signal_emit("gui exit", 0); } -/* SYNTAX: MSG [-<server tag>] [-channel | -nick] <targets> <message> */ +/* SYNTAX: MSG [-<server tag>] [-channel | -nick] *|<targets> <message> */ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) { GHashTable *optlist; diff --git a/src/core/commands.h b/src/core/commands.h index c68c5b24..d65185e5 100644 --- a/src/core/commands.h +++ b/src/core/commands.h @@ -158,7 +158,7 @@ char *cmd_get_quoted_param(char **data); /* get parameters from command - you should point free_me somewhere and cmd_params_free() it after you don't use any of the parameters anymore. - Returns TRUE if all ok, FALSE if error occured. */ + Returns TRUE if all ok, FALSE if error occurred. */ int cmd_get_params(const char *data, gpointer *free_me, int count, ...); void cmd_params_free(void *free_me); diff --git a/src/core/expandos.c b/src/core/expandos.c index bed6c5eb..1fc517af 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -57,7 +57,7 @@ static char *last_sent_msg, *last_sent_msg_body; static char *last_privmsg_from, *last_public_from; static char *sysname, *sysrelease, *sysarch; -static const char *timestamp_format; +static char *timestamp_format; static int timestamp_seconds; static time_t last_timestamp; @@ -567,7 +567,9 @@ static int sig_timer(void) static void read_settings(void) { - timestamp_format = settings_get_str("timestamp_format"); + g_free_not_null(timestamp_format); + timestamp_format = g_strdup(settings_get_str("timestamp_format")); + timestamp_seconds = strstr(timestamp_format, "%r") != NULL || strstr(timestamp_format, "%s") != NULL || @@ -708,14 +710,18 @@ void expandos_deinit(void) g_free_not_null(char_expandos[n]); g_hash_table_foreach_remove(expandos, free_expando, NULL); - g_hash_table_destroy(expandos); + g_hash_table_destroy(expandos); - g_free_not_null(last_sent_msg); g_free_not_null(last_sent_msg_body); - g_free_not_null(last_privmsg_from); g_free_not_null(last_public_from); - g_free_not_null(sysname); g_free_not_null(sysrelease); - g_free_not_null(sysarch); + g_free_not_null(last_sent_msg); + g_free_not_null(last_sent_msg_body); + g_free_not_null(last_privmsg_from); + g_free_not_null(last_public_from); + g_free_not_null(sysname); + g_free_not_null(sysrelease); + g_free_not_null(sysarch); + g_free_not_null(timestamp_format); - g_source_remove(timer_tag); + g_source_remove(timer_tag); signal_remove("message public", (SIGNAL_FUNC) sig_message_public); signal_remove("message private", (SIGNAL_FUNC) sig_message_private); signal_remove("message own_private", (SIGNAL_FUNC) sig_message_own_private); diff --git a/src/core/log.c b/src/core/log.c index 263b3526..d4d3853e 100644 --- a/src/core/log.c +++ b/src/core/log.c @@ -41,7 +41,7 @@ static const char *log_item_types[] = { NULL }; -const char *log_timestamp; +static char *log_timestamp; static int log_file_create_mode; static int log_dir_create_mode; static int rotate_tag; @@ -558,13 +558,15 @@ static void log_read_config(void) static void read_settings(void) { - log_timestamp = settings_get_str("log_timestamp"); + g_free_not_null(log_timestamp); + log_timestamp = g_strdup(settings_get_str("log_timestamp")); + log_file_create_mode = octal2dec(settings_get_int("log_create_mode")); - log_dir_create_mode = log_file_create_mode; - if (log_file_create_mode & 0400) log_dir_create_mode |= 0100; - if (log_file_create_mode & 0040) log_dir_create_mode |= 0010; - if (log_file_create_mode & 0004) log_dir_create_mode |= 0001; + log_dir_create_mode = log_file_create_mode; + if (log_file_create_mode & 0400) log_dir_create_mode |= 0100; + if (log_file_create_mode & 0040) log_dir_create_mode |= 0010; + if (log_file_create_mode & 0004) log_dir_create_mode |= 0001; } void log_init(void) @@ -595,7 +597,9 @@ void log_deinit(void) while (logs != NULL) log_close(logs->data); + g_free_not_null(log_timestamp); + signal_remove("setup changed", (SIGNAL_FUNC) read_settings); - signal_remove("setup reread", (SIGNAL_FUNC) log_read_config); - signal_remove("irssi init finished", (SIGNAL_FUNC) log_read_config); + signal_remove("setup reread", (SIGNAL_FUNC) log_read_config); + signal_remove("irssi init finished", (SIGNAL_FUNC) log_read_config); } diff --git a/src/core/net-nonblock.h b/src/core/net-nonblock.h index 32cfac70..af5968c8 100644 --- a/src/core/net-nonblock.h +++ b/src/core/net-nonblock.h @@ -29,7 +29,7 @@ int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe, int reverse_lookup); /* Get host's name, call func when finished */ int net_gethostbyaddr_nonblock(IPADDR *ip, NET_HOST_CALLBACK func, void *data); -/* get the resolved IP address. returns -1 if some error occured with read() */ +/* get the resolved IP address. returns -1 if some error occurred with read() */ int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec); /* Connect to server, call func when finished */ diff --git a/src/core/net-sendbuffer.c b/src/core/net-sendbuffer.c index 9d4b0e37..39257486 100644 --- a/src/core/net-sendbuffer.c +++ b/src/core/net-sendbuffer.c @@ -109,7 +109,7 @@ static int buffer_add(NET_SENDBUF_REC *rec, const void *data, int size) /* Send data, if all of it couldn't be sent immediately, it will be resent automatically after a while. Returns -1 if some unrecoverable error - occured. */ + occurred. */ int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size) { int ret; diff --git a/src/core/net-sendbuffer.h b/src/core/net-sendbuffer.h index 785f59ae..bdeb7156 100644 --- a/src/core/net-sendbuffer.h +++ b/src/core/net-sendbuffer.h @@ -24,7 +24,7 @@ void net_sendbuffer_destroy(NET_SENDBUF_REC *rec, int close); /* Send data, if all of it couldn't be sent immediately, it will be resent automatically after a while. Returns -1 if some unrecoverable error - occured. */ + occurred. */ int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size); int net_sendbuffer_receive_line(NET_SENDBUF_REC *rec, char **str, int read_socket); diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c index 768fd540..e16403ec 100644 --- a/src/core/network-openssl.c +++ b/src/core/network-openssl.c @@ -475,7 +475,7 @@ static GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, int port, SERVER_ g_error("Could not allocate memory for SSL context"); return NULL; } - SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2); + SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3); SSL_CTX_set_default_passwd_cb(ctx, get_pem_password_callback); SSL_CTX_set_default_passwd_cb_userdata(ctx, (void *)mypass); diff --git a/src/core/network.c b/src/core/network.c index 3659ab36..bfaa47fb 100644 --- a/src/core/network.c +++ b/src/core/network.c @@ -624,7 +624,7 @@ const char *net_gethosterror(int error) int net_hosterror_notfound(int error) { #ifdef HAVE_IPV6 -#ifdef EAI_NODATA /* NODATA is depricated */ +#ifdef EAI_NODATA /* NODATA is deprecated */ return error != 1 && (error == EAI_NONAME || error == EAI_NODATA); #else return error != 1 && (error == EAI_NONAME); diff --git a/src/core/nicklist.c b/src/core/nicklist.c index a5f25f34..b1c9ecef 100644 --- a/src/core/nicklist.c +++ b/src/core/nicklist.c @@ -342,7 +342,7 @@ GSList *nicklist_get_same_unique(SERVER_REC *server, void *id) return rec.list; } -/* nick record comparision for sort functions */ +/* nick record comparison for sort functions */ int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix) { int i; diff --git a/src/core/query-rec.h b/src/core/query-rec.h index fc08d2ef..59519ad4 100644 --- a/src/core/query-rec.h +++ b/src/core/query-rec.h @@ -7,5 +7,5 @@ char *server_tag; time_t last_unread_msg; unsigned int unwanted:1; /* TRUE if the other side closed or - some error occured (DCC chats!) */ + some error occurred (DCC chats!) */ unsigned int destroying:1; diff --git a/src/core/servers-reconnect.c b/src/core/servers-reconnect.c index 0a08b461..d99a5405 100644 --- a/src/core/servers-reconnect.c +++ b/src/core/servers-reconnect.c @@ -253,6 +253,9 @@ static void sig_reconnect(SERVER_REC *server) conn->port = server->connrec->port; conn->password = g_strdup(server->connrec->password); + if (strchr(conn->address, '/') != NULL) + conn->unix_socket = TRUE; + server_reconnect_add(conn, (server->connect_time == 0 ? time(NULL) : server->connect_time) + reconnect_time); server_connect_unref(conn); diff --git a/src/core/servers-setup.c b/src/core/servers-setup.c index 0819ff1a..27d9f1f0 100644 --- a/src/core/servers-setup.c +++ b/src/core/servers-setup.c @@ -122,6 +122,9 @@ static void server_setup_fill(SERVER_CONNECT_REC *conn, conn->address = g_strdup(address); if (port > 0) conn->port = port; + if (strchr(address, '/') != NULL) + conn->unix_socket = TRUE; + if (!conn->nick) conn->nick = g_strdup(settings_get_str("nick")); conn->username = g_strdup(settings_get_str("user_name")); conn->realname = g_strdup(settings_get_str("real_name")); diff --git a/src/core/servers.c b/src/core/servers.c index 06f82d4d..6eaad191 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -218,9 +218,7 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip, return; if (ip != NULL) { - own_ip = ip == NULL ? NULL : - (IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : - server->connrec->own_ip4); + own_ip = IPADDR_IS_V6(ip) ? server->connrec->own_ip6 : server->connrec->own_ip4; port = server->connrec->proxy != NULL ? server->connrec->proxy_port : server->connrec->port; handle = server->connrec->use_ssl ? |