parent: Use 'zip' alias of 'zlib' decoder
SSH command size: 448 (-5 bytes) Preamble size: 8941 (no change) NB: The 'zip' alias was absent in Python 3.x, until Python 3.4. This should change be reverted if Python 3.0, 3.2, or 3.3 support is required.
This commit is contained in:
parent
0f82f68fee
commit
48949cd249
|
@ -340,7 +340,7 @@ class Stream(mitogen.core.Stream):
|
||||||
os.environ['ARGV0']=e=sys.executable
|
os.environ['ARGV0']=e=sys.executable
|
||||||
os.execv(e,['mitogen:CONTEXT_NAME'])
|
os.execv(e,['mitogen:CONTEXT_NAME'])
|
||||||
os.write(1,'EC0\n')
|
os.write(1,'EC0\n')
|
||||||
C=_(sys.stdin.read(PREAMBLE_COMPRESSED_LEN), 'zlib')
|
C=_(sys.stdin.read(PREAMBLE_COMPRESSED_LEN), 'zip')
|
||||||
os.fdopen(W,'w',0).write(C)
|
os.fdopen(W,'w',0).write(C)
|
||||||
os.fdopen(w,'w',0).write('PREAMBLE_LEN\n'+C)
|
os.fdopen(w,'w',0).write('PREAMBLE_LEN\n'+C)
|
||||||
os.write(1,'EC1\n')
|
os.write(1,'EC1\n')
|
||||||
|
@ -362,7 +362,7 @@ class Stream(mitogen.core.Stream):
|
||||||
return [
|
return [
|
||||||
self.python_path, '-c',
|
self.python_path, '-c',
|
||||||
'import codecs;_=codecs.decode;'
|
'import codecs;_=codecs.decode;'
|
||||||
'exec(_(_("%s".encode(),"base64"),"zlib"))' % (encoded,)
|
'exec(_(_("%s".encode(),"base64"),"zip"))' % (encoded,)
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_preamble(self):
|
def get_preamble(self):
|
||||||
|
|
Loading…
Reference in New Issue