Maulieo / flist-pidgin

Automatically exported from code.google.com/p/flist-pidgin
0 stars 0 forks source link

Connection aborts saying "The server sent non-JSON data" #34

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use json-glib 1.0 (LATEST, 
http://ftp.acc.umu.se/pub/GNOME/sources/json-glib/1.0/)

What is the expected output? What do you see instead?
I expect to be able to login normally, but login aborts, saying "The server 
sent non-JSON data".

What version of the product are you using? On what operating system?
flist-pidgin compiled from source, json-glib 1.0 (see above)

Please provide any additional information below.
The error comes from json-glib and is handled in f-list_connection.c, lines 
179-185. Printing out debug information (error->message), I got: 
"(19:57:46) flist: JSON error: JSON data must be UTF-8 encoded(19:57:46) 
connection: Connection error on 0x206b6d0 (reason: 0 description: The server 
sent non-JSON data.)"

This suggests that the F-List chat server does not encode its data using UTF-8 
(which is the default encoding for JSON).

Original issue reported on code.google.com by will...@gmail.com on 19 Apr 2014 at 5:59

GoogleCodeExporter commented 8 years ago
Downgrading to json-glib 0.16 solves the problem. This really seems to be a 
F-Chat issue more than a flist-pidgin one, JSON should be encoded using UTF-8.

Original comment by will...@gmail.com on 19 Apr 2014 at 6:04

GoogleCodeExporter commented 8 years ago
This is actually a json-glib bug, which was fixed upstream :
https://bugzilla.gnome.org/show_bug.cgi?id=727755

If are stuck with the buggy json-glib, a possible workaround would be to 
NULL-terminate the JSON data before sending it to json_parser_load_from_data in 
f-list_connection.c:179

Original comment by v...@jackal.fr on 30 May 2014 at 10:16

GoogleCodeExporter commented 8 years ago
Thanks. Updating json-glib fixed this.

Original comment by will...@gmail.com on 1 Aug 2014 at 1:54