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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user