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
ac7a64df
Commit
ac7a64df
authored
Mar 19, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: assign common expression to a variable.
parent
148ce1d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
mitogen/core.py
mitogen/core.py
+4
-4
No files found.
mitogen/core.py
View file @
ac7a64df
...
...
@@ -766,14 +766,14 @@ class Stream(BasicStream):
msg
=
Message
()
msg
.
router
=
self
.
_router
(
msg
.
dst_id
,
msg
.
src_id
,
msg
.
auth_id
,
msg
.
handle
,
msg
.
reply_to
,
msg_len
)
=
struct
.
unpack
(
self
.
HEADER_FMT
,
self
.
_input_buf
[
0
][:
self
.
HEADER_LEN
],
)
if
(
self
.
_input_buf_len
-
self
.
HEADER_LEN
)
<
msg_len
:
total_len
=
msg_len
+
self
.
HEADER_LEN
if
self
.
_input_buf_len
<
total_len
:
_vv
and
IOLOG
.
debug
(
'%r: Input too short (want %d, got %d)'
,
self
,
msg_len
,
self
.
_input_buf_len
-
self
.
HEADER_LEN
...
...
@@ -782,7 +782,7 @@ class Stream(BasicStream):
start
=
self
.
HEADER_LEN
prev_start
=
start
remain
=
msg_len
+
start
remain
=
total_len
bits
=
[]
while
remain
:
buf
=
self
.
_input_buf
.
popleft
()
...
...
@@ -794,7 +794,7 @@ class Stream(BasicStream):
msg
.
data
=
''
.
join
(
bits
)
self
.
_input_buf
.
appendleft
(
buf
[
prev_start
+
len
(
bit
):])
self
.
_input_buf_len
-=
self
.
HEADER_LEN
+
msg
_len
self
.
_input_buf_len
-=
total
_len
self
.
_router
.
_async_route
(
msg
,
self
)
return
True
...
...
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