diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index 55f64264..9fd3995f 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -281,7 +281,23 @@ typedef struct tunnel_t void _tf_ssb_rpc_tunnel_callback(tf_ssb_connection_t* connection, uint8_t flags, int32_t request_number, JSValue args, const uint8_t* message, size_t size, void* user_data) { tunnel_t* tun = user_data; - tf_ssb_connection_rpc_send(tun->connection, flags, tun->request_number, message, size, NULL, NULL, NULL); + if (flags & k_ssb_rpc_flag_end_error) + { + tf_ssb_connection_rpc_send( + connection, + flags, + -request_number, + (const uint8_t*)"false", + strlen("false"), + NULL, + NULL, + NULL); + tf_ssb_connection_close(tun->connection); + } + else + { + tf_ssb_connection_rpc_send(tun->connection, flags, tun->request_number, message, size, NULL, NULL, NULL); + } } void _tf_ssb_rpc_tunnel_cleanup(tf_ssb_t* ssb, void* user_data)