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
2bc9419c
Commit
2bc9419c
authored
Sep 14, 2009
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMQII-10: Make connections interrupted during the init phase be closed silently
parent
37cacc57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
zmq_decoder.cpp
src/zmq_decoder.cpp
+11
-2
zmq_listener_init.cpp
src/zmq_listener_init.cpp
+5
-2
No files found.
src/zmq_decoder.cpp
View file @
2bc9419c
...
...
@@ -20,6 +20,7 @@
#include "zmq_decoder.hpp"
#include "i_inout.hpp"
#include "wire.hpp"
#include "err.hpp"
zmq
::
zmq_decoder_t
::
zmq_decoder_t
()
:
destination
(
NULL
)
...
...
@@ -48,7 +49,11 @@ bool zmq::zmq_decoder_t::one_byte_size_ready ()
if
(
*
tmpbuf
==
0xff
)
next_step
(
tmpbuf
,
8
,
&
zmq_decoder_t
::
eight_byte_size_ready
);
else
{
zmq_msg_init_size
(
&
in_progress
,
*
tmpbuf
);
// TODO: Handle over-sized message decently.
int
rc
=
zmq_msg_init_size
(
&
in_progress
,
*
tmpbuf
);
errno_assert
(
rc
==
0
);
next_step
(
zmq_msg_data
(
&
in_progress
),
*
tmpbuf
,
&
zmq_decoder_t
::
message_ready
);
}
...
...
@@ -60,7 +65,11 @@ bool zmq::zmq_decoder_t::eight_byte_size_ready ()
// 8-byte size is read. Allocate the buffer for message body and
// read the message data into it.
size_t
size
=
(
size_t
)
get_uint64
(
tmpbuf
);
zmq_msg_init_size
(
&
in_progress
,
size
);
// TODO: Handle over-sized message decently.
int
rc
=
zmq_msg_init_size
(
&
in_progress
,
size
);
errno_assert
(
rc
==
0
);
next_step
(
zmq_msg_data
(
&
in_progress
),
size
,
&
zmq_decoder_t
::
message_ready
);
return
true
;
...
...
src/zmq_listener_init.cpp
View file @
2bc9419c
...
...
@@ -93,8 +93,11 @@ void zmq::zmq_listener_init_t::flush ()
void
zmq
::
zmq_listener_init_t
::
detach
()
{
// TODO: Engine is closing down. Init object is to be closed as well.
zmq_assert
(
false
);
// This function is called by engine when disconnection occurs.
// The engine will destroy itself, so we just drop the pointer here and
// start termination of the init object.
engine
=
NULL
;
term
();
}
void
zmq
::
zmq_listener_init_t
::
process_plug
()
...
...
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