Daemon not processing JSON correctly #19

Closed
opened 2016-04-12 03:12:58 +02:00 by mikegioia · 1 comment
mikegioia commented 2016-04-12 03:12:58 +02:00 (Migrated from github.com)

Periodically, JSON messages from the sync process to the daemon process logs JSON partials to the console. I imagine this is because it's not parsing the response correctly. Maybe JSON is being split into multiple messages and the "}" isn't the last character of the message?

The JSON deciphering is hacky right now, so a sigil might be needed to denote the beginning and end of the message.

Periodically, JSON messages from the sync process to the daemon process logs JSON partials to the console. I imagine this is because it's not parsing the response correctly. Maybe JSON is being split into multiple messages and the "}" isn't the last character of the message? The JSON deciphering is hacky right now, so a sigil might be needed to denote the beginning and end of the message.
mikegioia commented 2016-04-12 05:36:29 +02:00 (Migrated from github.com)

The detection of "}" to signal the end of the message fails when a partial happens to have "}" at the end of the received chunk >_<

A better system of detecting JSON is needed. Either a streaming parser or a message size is needed in the header. Like a 4-byte message size header.

The detection of "}" to signal the end of the message fails when a partial happens to have "}" at the end of the received chunk >_< A better system of detecting JSON is needed. Either a streaming parser or a message size is needed in the header. Like a 4-byte message size header.
Sign in to join this conversation.
No description provided.