mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
Fix upgrade of relay clients in state "disconnected" (do not create any hook after /upgrade)
This commit is contained in:
@@ -1017,7 +1017,16 @@ relay_client_irc_alloc_with_infolist (struct t_relay_client *client,
|
||||
RELAY_IRC_DATA(client, nick) = strdup (weechat_infolist_string (infolist, "nick"));
|
||||
RELAY_IRC_DATA(client, user_received) = weechat_infolist_integer (infolist, "user_received");
|
||||
RELAY_IRC_DATA(client, connected) = weechat_infolist_integer (infolist, "connected");
|
||||
relay_client_irc_hook_signals (client);
|
||||
if (RELAY_IRC_DATA(client, connected))
|
||||
{
|
||||
relay_client_irc_hook_signals (client);
|
||||
}
|
||||
else
|
||||
{
|
||||
RELAY_IRC_DATA(client, hook_signal_irc_in2) = NULL;
|
||||
RELAY_IRC_DATA(client, hook_signal_irc_outtags) = NULL;
|
||||
RELAY_IRC_DATA(client, hook_signal_irc_disc) = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,10 +182,15 @@ relay_upgrade_read_cb (void *data,
|
||||
new_client->listen_start_time = weechat_infolist_time (infolist, "listen_start_time");
|
||||
new_client->start_time = weechat_infolist_time (infolist, "start_time");
|
||||
new_client->end_time = weechat_infolist_time (infolist, "end_time");
|
||||
new_client->hook_fd = weechat_hook_fd (new_client->sock,
|
||||
1, 0, 0,
|
||||
&relay_client_recv_cb,
|
||||
new_client);
|
||||
if (new_client->sock >= 0)
|
||||
{
|
||||
new_client->hook_fd = weechat_hook_fd (new_client->sock,
|
||||
1, 0, 0,
|
||||
&relay_client_recv_cb,
|
||||
new_client);
|
||||
}
|
||||
else
|
||||
new_client->hook_fd = NULL;
|
||||
new_client->last_activity = weechat_infolist_time (infolist, "last_activity");
|
||||
sscanf (weechat_infolist_string (infolist, "bytes_recv"),
|
||||
"%lu", &(new_client->bytes_recv));
|
||||
|
||||
Reference in New Issue
Block a user