diff --git a/src/ssb.c b/src/ssb.c index c7da9419..9b4eb12b 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -545,7 +545,7 @@ static void _tf_ssb_nonce_inc(uint8_t* nonce) static void _tf_ssb_connection_box_stream_send(tf_ssb_connection_t* connection, const uint8_t* message, size_t size) { - const size_t k_send_max = 65535; + const size_t k_send_max = 4096; for (size_t offset = 0; offset < size; offset += k_send_max) { size_t send_size = size - offset > k_send_max ? k_send_max : size - offset; @@ -764,7 +764,7 @@ void tf_ssb_connection_rpc_send_error(tf_ssb_connection_t* connection, uint8_t f JS_SetPropertyStr(context, message, "name", JS_NewString(context, "Error")); JS_SetPropertyStr(context, message, "stack", JS_NewString(context, stack ? stack : "stack unavailable")); JS_SetPropertyStr(context, message, "message", JS_NewString(context, error)); - tf_ssb_connection_rpc_send_json(connection, ((flags & k_ssb_rpc_flag_stream) ? (k_ssb_rpc_flag_stream | k_ssb_rpc_flag_end_error) : 0), request_number, message, NULL, NULL, NULL); + tf_ssb_connection_rpc_send_json(connection, ((flags & k_ssb_rpc_flag_stream) ? (k_ssb_rpc_flag_stream) : 0) | k_ssb_rpc_flag_end_error, request_number, message, NULL, NULL, NULL); JS_FreeValue(context, message); tf_free((void*)stack); } diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index 2cc49646..2040047d 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -694,7 +694,9 @@ static void _tf_ssb_rpc_connection_room_attendants_callback(tf_ssb_connection_t* } else { - tf_ssb_connection_rpc_send_error(connection, flags, -request_number, "Unexpected room.attendants response type."); + char buffer[256]; + snprintf(buffer, sizeof(buffer), "Unexpected room.attendants response type: '%s'.", type_string); + tf_ssb_connection_rpc_send_error(connection, flags, -request_number, buffer); } JS_FreeCString(context, type_string); JS_FreeValue(context, type);