Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
1788fd39
Commit
1788fd39
authored
Apr 25, 2012
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pipe: code cleanup
parent
648e3199
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
pipe.cpp
src/pipe.cpp
+7
-11
No files found.
src/pipe.cpp
View file @
1788fd39
...
...
@@ -255,13 +255,11 @@ void zmq::pipe_t::process_pipe_term ()
state
=
terminating
;
outpipe
=
NULL
;
send_pipe_term_ack
(
peer
);
return
;
}
else
{
else
state
=
pending
;
return
;
}
}
// Delimiter happened to arrive before the term command. Now we have the
// term command as well, so we can move straight to terminating state.
...
...
@@ -296,14 +294,12 @@ void zmq::pipe_t::process_pipe_term_ack ()
// Simply deallocate the pipe. In terminated state we have to ack the
// peer before deallocating this side of the pipe. All the other states
// are invalid.
if
(
state
==
terminating
)
;
else
if
(
state
==
double_terminated
);
else
if
(
state
==
terminated
)
{
if
(
state
==
terminated
)
{
outpipe
=
NULL
;
send_pipe_term_ack
(
peer
);
}
else
zmq_assert
(
false
);
zmq_assert
(
state
==
terminating
||
state
==
double_terminated
);
// We'll deallocate the inbound pipe, the peer will deallocate the outbound
// pipe (which is an inbound pipe from its point of view).
...
...
@@ -351,7 +347,7 @@ void zmq::pipe_t::terminate (bool delay_)
}
// If there are pending messages still availabe, do nothing.
else
if
(
state
==
pending
&&
delay
)
{
else
if
(
state
==
pending
)
{
}
// We've already got delimiter, but not term command yet. We can ignore
...
...
@@ -371,11 +367,11 @@ void zmq::pipe_t::terminate (bool delay_)
if
(
outpipe
)
{
//
Rollback
any unfinished outbound messages.
//
Drop
any unfinished outbound messages.
rollback
();
//
Push delimiter into the outbound
pipe. Note that watermarks are not
// checked
thus the delimiter can be written even though
the pipe is full.
//
Write the delimiter into the
pipe. Note that watermarks are not
// checked
; thus the delimiter can be written even when
the pipe is full.
msg_t
msg
;
msg
.
init_delimiter
();
outpipe
->
write
(
msg
,
false
);
...
...
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