v1.0.5 - Just catching up

This commit is contained in:
Your Name
2025-11-11 17:01:39 -04:00
parent b276b44ded
commit 7b74486519
7 changed files with 628 additions and 13 deletions

View File

@@ -12,8 +12,8 @@
// Version information (auto-updated by build system)
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_PATCH 4
#define VERSION "v1.0.4"
#define VERSION_PATCH 5
#define VERSION "v1.0.5"
// Avoid VERSION_MAJOR redefinition warning from nostr_core_lib
#undef VERSION_MAJOR

View File

@@ -497,8 +497,8 @@ static int nostr_relay_callback(struct lws *wsi, enum lws_callback_reasons reaso
if (pss->reassembly_buffer) {
DEBUG_WARN("Starting new reassembly but buffer already exists - cleaning up");
free(pss->reassembly_buffer);
pss->reassembly_buffer = NULL; // Ensure buffer is NULL after cleanup
}
pss->reassembly_buffer = NULL;
pss->reassembly_size = 0;
pss->reassembly_capacity = 0;
pss->reassembly_active = 1;
@@ -546,8 +546,9 @@ static int nostr_relay_callback(struct lws *wsi, enum lws_callback_reasons reaso
char* complete_message = pss->reassembly_buffer;
size_t message_len = pss->reassembly_size;
// Reset reassembly state (but keep buffer for reuse if needed)
// Reset reassembly state (keep buffer pointer for processing)
pss->reassembly_size = 0;
pss->reassembly_active = 0;
// Parse JSON message
DEBUG_TRACE("Parsing reassembled JSON message of length %zu", message_len);
@@ -1163,8 +1164,10 @@ static int nostr_relay_callback(struct lws *wsi, enum lws_callback_reasons reaso
// Clean up the reassembled message
if (json) cJSON_Delete(json);
// Note: complete_message points to reassembly_buffer, which is managed separately
// and should not be freed here - it will be cleaned up in LWS_CALLBACK_CLOSED
// Free the reassembly buffer now that processing is complete
free(complete_message);
pss->reassembly_buffer = NULL;
pss->reassembly_capacity = 0;
return 0; // Fragmented message processed
} else {