fix: splitting of big UI messages

Determine the needed buffer space first, instead of trying to revert the
effect of prepare_call if message does not fit. The previous code did
not revert the full state, which caused corrupted messages to be sent.
So, rather than trying to fix all of that, with fragile and hard to read
code as a result, the code is now much more simple, although slightly
slower.
This commit is contained in:
Fred Sundvik
2024-02-05 14:39:54 +02:00
parent d6483793e1
commit a090d43d61
2 changed files with 53 additions and 49 deletions

View File

@@ -46,7 +46,6 @@ typedef struct {
// state for write_cb, while packing a single arglist to msgpack. This
// might fail due to buffer overflow.
size_t pack_totlen;
bool buf_overflow;
char *temp_buf;
// We start packing the two outermost msgpack arrays before knowing the total