cJSON icon indicating copy to clipboard operation
cJSON copied to clipboard

Number of characters parsed

Open chandanavelaga opened this issue 9 years ago • 8 comments
trafficstars

The parser parses only 1024 characters!what if my need to parse more.

chandanavelaga avatar Jun 23 '16 06:06 chandanavelaga

The parser definitely parses more than 1024 characters!

FSMaxB avatar Jun 23 '16 09:06 FSMaxB

Maybe you can describe the problems you are experiencing in more detail.

FSMaxB avatar Jun 23 '16 09:06 FSMaxB

I am receiving a json message from a client through a socket which is being stored in a buffer variable. Now i am parsing the buffer but it is parsing only 1024 characters and it shows an error in json after that(I have used the cJSON_GetErrorPtr() for this) I have verified that the json is valid. Not understanding where exactly its going wrong.

Thanks.

On Thu, Jun 23, 2016 at 3:18 PM, Max Bruckner [email protected] wrote:

Maybe you can describe the problems you are experiencing in more detail.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kbranigan/cJSON/issues/37#issuecomment-228002018, or mute the thread https://github.com/notifications/unsubscribe/AHUDYaH6YE6uxzGT0w3pVWiY9Qn3a2hSks5qOlZQgaJpZM4I8faJ .

chandanavelaga avatar Jun 23 '16 11:06 chandanavelaga

Could you provide the JSON that causes the error?

FSMaxB avatar Jun 23 '16 15:06 FSMaxB

[{"profile_data": [{"uuid": "wgdk", "Profile_ID": "0001", "action": "du", "ifIndex": "kdk", "model": "kk", "id": 2082}], "Inheritance": "false", "Profile_ID": "0001", "Local_Trigger": "false", "Fault_Tolerant": "false", "Profile_Name": "Terminal 1", "Profile_Desc": "Boarding in 10 mins"}, {"profile_data": [], "Inheritance": "false", "Profile_ID": "0002", "Local_Trigger": "false", "Fault_Tolerant": "false", "Profile_Name": "Terminal 2", "Profile_Desc": "Boarding in 20 mins"}, {"profile_data": [], "Inheritance": "false", "Profile_ID": "0003", "Local_Trigger": "false", "Fault_Tolerant": "false", "Profile_Name": "Terminal 3", "Profile_Desc": "Boarding in 30 mins"}, {"profile_data": [], "Inheritance": "kk", "Profile_ID": "ihfkhf", "Local_Trigger": "djddhd", "Fault_Tolerant": "dvjdsj", "Profile_Name": "wgdk", "Profile_Desc": "kdk"}, {"profile_data": [], "Inheritance": "kk", "Profile_ID": "ihfkgsjdgkjhf", "Local_Trigger": "djddhd", "Fault_Tolerant": "dvjdsj", "Profile_Name": "wgdk", "Profile_Desc": "kdk"}, {"profile_data": [{"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2086}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2087}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2088}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2089}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2090}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2091}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2092}, {"uuid": "wgdk", "Profile_ID": "1234f", "action": "dvjdsj", "ifIndex": "kdk", "model": "kk", "id": 2093}], "Inheritance": "kk", "Profile_ID": "1234f", "Local_Trigger": "djddhd", "Fault_Tolerant": "dvjdsj", "Profile_Name": "wgdk", "Profile_Desc": "kdk"}, {"profile_data": [{"uuid": "wgdk", "Profile_ID": "123f", "action": "du", "ifIndex": "kdk", "model": "kk", "id": 2084}, {"uuid": "wgdk", "Profile_ID": "123f", "action": "du", "ifIndex": "8kdk", "model": "kk", "id": 2085}], "Inheritance": "kk", "Profile_ID": "123f", "Local_Trigger": "djddhd", "Fault_Tolerant": "dvjdsj", "Profile_Name": "wgdk", "Profile_Desc": "kdk"}, {"profile_data": [{"uuid": "wgdk", "Profile_ID": "123", "action": "du", "ifIndex": "kdk", "model": "kk", "id": 2083}], "Inheritance": "kk", "Profile_ID": "123", "Local_Trigger": "djddhd", "Fault_Tolerant": "dvjdsj", "Profile_Name": "wgdk", "Profile_Desc": "kdk"}]

On Thu, Jun 23, 2016 at 9:17 PM, Max Bruckner [email protected] wrote:

Could you provide the JSON that causes the error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kbranigan/cJSON/issues/37#issuecomment-228093739, or mute the thread https://github.com/notifications/unsubscribe/AHUDYezWoVdc6YsDZxobpk48aB6WK9mWks5qOqqQgaJpZM4I8faJ .

chandanavelaga avatar Jun 24 '16 03:06 chandanavelaga

I've just checked. This JSON works just fine (I tested with the dofile function in test.c. Current master branch, commit c4e9c1d41fa38694a02ed2fdf25622fc39634ed8).

Maybe there is a problem with your buffer variable?

FSMaxB avatar Jun 25 '16 18:06 FSMaxB

Ok i will check.Thank you so much! On Jun 25, 2016 11:41 PM, "Max Bruckner" [email protected] wrote:

I've just checked. This JSON works just fine (I tested with the dofile function in test.c. Current master branch, commit c4e9c1d41fa38694a02ed2fdf25622fc39634ed8).

Maybe there is a problem with your buffer variable?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kbranigan/cJSON/issues/37#issuecomment-228562889, or mute the thread https://github.com/notifications/unsubscribe/AHUDYdXKX-DLo6xjTzuQ1rH-LQOawCTaks5qPW9pgaJpZM4I8faJ .

chandanavelaga avatar Jun 26 '16 05:06 chandanavelaga

Good luck!

FSMaxB avatar Jun 26 '16 07:06 FSMaxB