def createMsg(self, body, replyflags=0):
pflgs=replyflags
if _has_compression and Pyro.config.PYRO_COMPRESSION:
before=len(body)
bz=zlib.compress(body) # default compression level
if len(bz)<before:
pflgs|=PFLG_COMPRESSED
body=bz
crc=0
if Pyro.config.PYRO_CHECKSUM and _has_compression:
crc=zlib.adler32(body)
pflgs|=PFLG_CHECKSUM
if Pyro.config.PYRO_XML_PICKLE=='gnosis':
pflgs|=PFLG_XMLPICKLE_GNOSIS
return struct.pack(self.headerFmt, self.headerID, self.version, self.headerSize, len(body), pflgs, crc) + body
评论列表
文章目录