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
6117a2b0
Commit
6117a2b0
authored
Jun 12, 2012
by
Ian Barber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Replace incomplete count with a std::set"
This reverts commit
4aa5ba3d
. Unintentional merge
parent
4aa5ba3d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
session_base.cpp
src/session_base.cpp
+19
-14
session_base.hpp
src/session_base.hpp
+2
-2
test_connect_delay.cpp
tests/test_connect_delay.cpp
+2
-0
No files found.
src/session_base.cpp
View file @
6117a2b0
...
...
@@ -111,6 +111,7 @@ zmq::session_base_t::session_base_t (class io_thread_t *io_thread_,
io_object_t
(
io_thread_
),
connect
(
connect_
),
pipe
(
NULL
),
incomplete_detach
(
0
),
incomplete_in
(
false
),
pending
(
false
),
engine
(
NULL
),
...
...
@@ -230,26 +231,31 @@ void zmq::session_base_t::clean_pipes ()
void
zmq
::
session_base_t
::
terminated
(
pipe_t
*
pipe_
)
{
// Drop the reference to the deallocated pipe if required.
zmq_assert
(
pipe
==
pipe_
||
incomplete_pipes
.
size
()
>
0
);
if
(
pipe
==
pipe_
)
// If this is our current pipe, remove it
pipe
=
NULL
;
else
// Remove the pipe from the detached pipes set
incomplete_pipes
.
erase
(
pipe_
);
zmq_assert
(
pipe
==
pipe_
||
incomplete_detach
>
0
);
// If we still have pipes outstanding, decrement.
// This will only have been set in a disconnect situation
// where delay_attach_on_connect is 1.
if
(
incomplete_detach
>
0
)
incomplete_detach
--
;
// If there are still extra detached pipes, don't continue
if
(
incomplete_detach
>
0
)
return
;
pipe
=
NULL
;
// If we are waiting for pending messages to be sent, at this point
// we are sure that there will be no more messages and we can proceed
// with termination safely.
if
(
pending
&&
!
pipe
&&
incomplete_pipes
.
size
()
==
0
)
if
(
pending
)
proceed_with_term
();
}
void
zmq
::
session_base_t
::
read_activated
(
pipe_t
*
pipe_
)
{
// Skip activating if we're detaching this pipe
if
(
incomplete_
pipes
.
size
()
>
0
&&
pipe_
!=
pipe
)
if
(
incomplete_
detach
>
0
&&
pipe_
!=
pipe
)
return
;
zmq_assert
(
pipe
==
pipe_
);
...
...
@@ -263,7 +269,7 @@ void zmq::session_base_t::read_activated (pipe_t *pipe_)
void
zmq
::
session_base_t
::
write_activated
(
pipe_t
*
pipe_
)
{
// Skip activating if we're detaching this pipe
if
(
incomplete_
pipes
.
size
()
>
0
&&
pipe_
!=
pipe
)
if
(
incomplete_
detach
>
0
&&
pipe_
!=
pipe
)
return
;
zmq_assert
(
pipe
==
pipe_
);
...
...
@@ -305,7 +311,7 @@ void zmq::session_base_t::process_attach (i_engine *engine_)
zmq_assert
(
engine_
!=
NULL
);
// Create the pipe if it does not exist yet.
if
(
!
pipe
&&
!
is_terminating
())
{
if
(
(
!
pipe
||
incomplete_detach
>
0
)
&&
!
is_terminating
())
{
object_t
*
parents
[
2
]
=
{
this
,
socket
};
pipe_t
*
pipes
[
2
]
=
{
NULL
,
NULL
};
int
hwms
[
2
]
=
{
options
.
rcvhwm
,
options
.
sndhwm
};
...
...
@@ -415,8 +421,7 @@ void zmq::session_base_t::detached ()
&&
addr
->
protocol
!=
"pgm"
&&
addr
->
protocol
!=
"epgm"
)
{
pipe
->
hiccup
();
pipe
->
terminate
(
false
);
incomplete_pipes
.
insert
(
pipe
);
pipe
=
NULL
;
incomplete_detach
++
;
}
reset
();
...
...
src/session_base.hpp
View file @
6117a2b0
...
...
@@ -104,8 +104,8 @@ namespace zmq
// Pipe connecting the session to its socket.
zmq
::
pipe_t
*
pipe
;
// This
set is added to with pipes
we are disconnecting, but haven't yet completed
std
::
set
<
pipe_t
*>
incomplete_pipes
;
// This
flag is set if
we are disconnecting, but haven't yet completed
int
incomplete_detach
;
// This flag is true if the remainder of the message being processed
// is still in the in pipe.
...
...
tests/test_connect_delay.cpp
View file @
6117a2b0
...
...
@@ -33,6 +33,8 @@ static void *server (void *c)
char
buffer
[
16
];
int
rc
,
val
;
shoulddie
=
*
(
long
*
)
sd
;
context
=
zmq_init
(
1
);
assert
(
context
);
...
...
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