1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 00:03:12 +02:00

relay/api: disconnect from remote in case of error when sending data

This commit is contained in:
Sébastien Helleu
2024-08-09 18:26:02 +02:00
parent 995cbe542e
commit b4d0054f07
16 changed files with 90 additions and 16 deletions
@@ -657,7 +657,15 @@ relay_remote_event_buffer_input_cb (const void *pointer,
cJSON_CreateString (input_data));
cJSON_AddItemToObject (json, "body", json_body);
relay_remote_network_send_json (ptr_remote, json);
if (relay_remote_network_send_json (ptr_remote, json) <= 0)
{
weechat_printf (
NULL,
_("%sremote[%s]: unable to send data, disconnecting"),
weechat_prefix ("error"),
ptr_remote->name);
relay_remote_network_disconnect (ptr_remote);
}
cJSON_Delete (json);