Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
f999b9ad
Commit
f999b9ad
authored
Mar 06, 2018
by
Alex Willmer
Committed by
David Wilson
Mar 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Crank zlib.compress() upto 9
SSH command size: 482 bytes (no change) Preamble size: 8946 bytes (down 33)
parent
9aa83ef7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
mitogen/core.py
mitogen/core.py
+1
-1
mitogen/master.py
mitogen/master.py
+1
-2
mitogen/parent.py
mitogen/parent.py
+2
-2
No files found.
mitogen/core.py
View file @
f999b9ad
...
...
@@ -445,7 +445,7 @@ class Importer(object):
'mitogen.core'
,
None
,
'mitogen/core.py'
,
zlib
.
compress
(
core_src
),
zlib
.
compress
(
core_src
,
9
),
[],
)
...
...
mitogen/master.py
View file @
f999b9ad
...
...
@@ -522,13 +522,12 @@ class ModuleResponder(object):
if fullname == '
__main__
':
source = self.neutralize_main(source)
compressed = zlib.compress(source)
compressed = zlib.compress(source
, 9
)
related = [
name
for name in self._finder.find_related(fullname)
if not mitogen.core.is_blacklisted_import(self, name)
]
# 0:fullname 1:pkg_present 2:path 3:compressed 4:related
tup = fullname, pkg_present, path, compressed, related
self._cache[fullname] = tup
...
...
mitogen/parent.py
View file @
f999b9ad
...
...
@@ -345,7 +345,7 @@ class Stream(mitogen.core.Stream):
source
=
textwrap
.
dedent
(
'
\
n
'
.
join
(
source
.
strip
().
split
(
'
\
n
'
)[
2
:]))
source
=
source
.
replace
(
' '
,
'
\
t
'
)
source
=
source
.
replace
(
'CONTEXT_NAME'
,
self
.
remote_name
)
encoded
=
source
.
encode
(
'zlib'
).
encode
(
'base64'
).
replace
(
'
\
n
'
,
''
)
encoded
=
zlib
.
compress
(
source
,
9
).
encode
(
'base64'
).
replace
(
'
\
n
'
,
''
)
# We can't use bytes.decode() in 3.x since it was restricted to always
# return unicode, so codecs.decode() is used instead. In 3.x
# codecs.decode() requires a bytes object. Since we must be compatible
...
...
@@ -372,7 +372,7 @@ class Stream(mitogen.core.Stream):
'blacklist'
:
self
.
_router
.
get_module_blacklist
(),
},)
compressed
=
zlib
.
compress
(
minimize_source
(
source
))
compressed
=
zlib
.
compress
(
minimize_source
(
source
)
,
9
)
return
str
(
len
(
compressed
))
+
'
\
n
'
+
compressed
create_child
=
staticmethod
(
create_child
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment