for UGC Entropy error report, use zlib

This commit is contained in:
Fabio Erculiani
2009-05-31 17:50:15 +02:00
parent 9e81ab4747
commit d65c147592
2 changed files with 9 additions and 3 deletions
@@ -707,11 +707,15 @@ class Client(Base):
def report_error(self, session_id, error_data):
xml_string = self.dumpTools.xml_from_dict_extended(error_data)
import zlib
xml_string = self.entropyTools.xml_from_dict_extended(error_data)
xml_comp_string = zlib.compress(xml_string)
#print len(xml_comp_string.split(" "))
cmd = "%s %s %s" % (
session_id,
'ugc:report_error',
xml_string,
xml_comp_string,
)
return self.do_generic_handler(cmd, session_id)
+3 -1
View File
@@ -784,8 +784,10 @@ class UGC(SocketCommands):
if not myargs:
return None, 'wrong arguments'
xml_string = ' '.join(myargs)
import zlib
comp_xml_string = ' '.join(myargs)
try:
xml_string = zlib.decompress(comp_xml_string)
mydict = self.entropyTools.dict_from_xml_extended(xml_string)
except Exception, e:
return None, "error: %s" % (e,)