Apparently the MUXRPC maximum segment size is 4096: bd350c6f9e/boxstream/box.go (L23). Reducing the send size seems to keep me connected to/through rooms longer.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4397 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-08-12 19:57:00 +00:00
parent e10803de68
commit e5425c0ffb
2 changed files with 5 additions and 3 deletions

View File

@ -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) 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) 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; 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, "name", JS_NewString(context, "Error"));
JS_SetPropertyStr(context, message, "stack", JS_NewString(context, stack ? stack : "stack unavailable")); JS_SetPropertyStr(context, message, "stack", JS_NewString(context, stack ? stack : "stack unavailable"));
JS_SetPropertyStr(context, message, "message", JS_NewString(context, error)); 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); JS_FreeValue(context, message);
tf_free((void*)stack); tf_free((void*)stack);
} }

View File

@ -694,7 +694,9 @@ static void _tf_ssb_rpc_connection_room_attendants_callback(tf_ssb_connection_t*
} }
else 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_FreeCString(context, type_string);
JS_FreeValue(context, type); JS_FreeValue(context, type);