decoding: fix decoding of large events like nostr reports
I was trying to do an initial malloc that was somewhat efficient. Looks like our ndb_builder needs a bit more space when allocating the ndb_note. Changelog-Fixed: Fixed nostr reporting decoding
This commit is contained in:
@@ -39,7 +39,7 @@ enum NostrResponse {
|
|||||||
|
|
||||||
static func owned_from_json(json: String) -> NostrResponse? {
|
static func owned_from_json(json: String) -> NostrResponse? {
|
||||||
return json.withCString{ cstr in
|
return json.withCString{ cstr in
|
||||||
let bufsize: Int = max(Int(Double(json.utf8.count) * 2.0), Int(getpagesize()))
|
let bufsize: Int = max(Int(Double(json.utf8.count) * 4.0), Int(getpagesize()))
|
||||||
let data = malloc(bufsize)
|
let data = malloc(bufsize)
|
||||||
|
|
||||||
if data == nil {
|
if data == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user