mirror of
https://github.com/weechat/weechat.git
synced 2026-07-03 16:23:14 +02:00
Fix lock when disconnecting SSL server that is not yet successfully connected
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
WeeChat - Wee Enhanced Environment for Chat
|
||||
===========================================
|
||||
|
||||
ChangeLog - 2008-10-05
|
||||
ChangeLog - 2008-10-19
|
||||
|
||||
|
||||
Version 0.2.7 (under dev!):
|
||||
* fix lock with SSL servers when connection fails, and when disconnecting
|
||||
during connection problem (bug #17584)
|
||||
* add new option scroll_page_percent to choose percent of height to scroll
|
||||
with page_up and page_down keys (task #8702)
|
||||
* add new /layout command and save_layout_on_exit config option, to
|
||||
|
||||
@@ -1842,30 +1842,34 @@ irc_server_timer_check_away (void *empty)
|
||||
void
|
||||
irc_server_close_connection (struct t_irc_server *server)
|
||||
{
|
||||
if (server->hook_connect)
|
||||
{
|
||||
weechat_unhook (server->hook_connect);
|
||||
server->hook_connect = NULL;
|
||||
}
|
||||
if (server->hook_fd)
|
||||
{
|
||||
weechat_unhook (server->hook_fd);
|
||||
server->hook_fd = NULL;
|
||||
}
|
||||
|
||||
/* close network socket */
|
||||
if (server->sock != -1)
|
||||
if (server->hook_connect)
|
||||
{
|
||||
weechat_unhook (server->hook_connect);
|
||||
server->hook_connect = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_GNUTLS
|
||||
if (server->ssl_connected)
|
||||
gnutls_bye (server->gnutls_sess, GNUTLS_SHUT_WR);
|
||||
/* close SSL connection */
|
||||
if ((server->sock != -1) && (server->ssl_connected))
|
||||
{
|
||||
if (server->ssl_connected)
|
||||
gnutls_bye (server->gnutls_sess, GNUTLS_SHUT_WR);
|
||||
if (server->ssl_connected)
|
||||
gnutls_deinit (server->gnutls_sess);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (server->sock != -1)
|
||||
{
|
||||
close (server->sock);
|
||||
server->sock = -1;
|
||||
#ifdef HAVE_GNUTLS
|
||||
if (server->ssl_connected)
|
||||
gnutls_deinit (server->gnutls_sess);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* free any pending message */
|
||||
|
||||
Reference in New Issue
Block a user