Closed acarslogger closed 6 years ago
really strange. It's could only be a problem with the cJSON lib or a bad use of the lib by vdlm2dec, because it outputs a just plain bad json Alas, its contributed code that I did not write, so I have to try to understand how the json lib works ...
Edit : Ok I have a clue. In fact, in the second bad message, the json is correctly outputted until the text output, then something brokes in cJSON lib and it don't write in the ouput buffer and don't even terminate it by a \0 , so you got what is remaining in the out buffer, which could be the previous long message. In your example 2 , 'text' in the second message comes one char earlier than in the first message, so you got these double ::
could you check commit 66e376fecc6c316ce8da45893c30a7370abb14c1
I have the new version up and running. Looks OK at the moment, but need to wait until I have a larger log file to analyse properly. Stuart
Hi Thierry. I've looked through the logs from the last 24 hours and everything looks good. I couldn't find any duplicates or corrupt data. Thanks
Great. By the way acarsdec had the same problem Thanks fot testing
Hi Thierry,
I've found some JSON format error / duplicated acars output in the JSON output. There are 2 examples below. I've included them in this 1 Github issue as I suspect that are all closely linked to one area of the source code.
The examples include the default log file output and the equivalent JSON output.
Example 1
BA018F (Msg No M33A) sent an FST01 message. There were then 2 acars messages without an actual acars message. Then BA13GV (Msg. no: D00A) sent a long H1 acars message.
The equivalent JSON output shows
The long BA13GV H1 message has been replaced with the original BA018F FST message and the json format has been corrupted to show "text":FST01EGLL . It's missing the " at the start of the FST message.
Example 2
AC0855 (Msg No D74M) sent a message starting with #DFB37 13 12 12 131334 There were then 2 acars messages without an actual acars message. Then W609AY (Msg. no: D02A) sent a H1 acars message with #DFBA321,007163,1,1,TB0.
The equivalent JSON output shows
The W609AY H1 message has been replaced with the original AC0855 '#DFB37 13 12 12 1313...' message and the json format has been corrupted to show "text"::"#DFB37 13 12 1 . It's now got 2 colons after the text token.
I can supply more examples if required. I haven't checked yet if this also applies to acarsdec. Regards Stuart