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
37fd1a77
Commit
37fd1a77
authored
Mar 31, 2010
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle full-pipe for REP sockets more gracefully
parent
2f219d7c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
rep.cpp
src/rep.cpp
+10
-4
No files found.
src/rep.cpp
View file @
37fd1a77
...
@@ -167,9 +167,6 @@ int zmq::rep_t::xsend (zmq_msg_t *msg_, int flags_)
...
@@ -167,9 +167,6 @@ int zmq::rep_t::xsend (zmq_msg_t *msg_, int flags_)
return
-
1
;
return
-
1
;
}
}
// Check whether it's last part of the reply.
more
=
msg_
->
flags
&
ZMQ_MSG_MORE
;
if
(
reply_pipe
)
{
if
(
reply_pipe
)
{
// Push message to the reply pipe.
// Push message to the reply pipe.
...
@@ -177,8 +174,14 @@ int zmq::rep_t::xsend (zmq_msg_t *msg_, int flags_)
...
@@ -177,8 +174,14 @@ int zmq::rep_t::xsend (zmq_msg_t *msg_, int flags_)
zmq_assert
(
!
more
||
written
);
zmq_assert
(
!
more
||
written
);
// The pipe is full...
// The pipe is full...
// When this happens, we simply return an error.
// This makes REP sockets vulnerable to DoS attack when
// misbehaving requesters stop collecting replies.
// TODO: Tear down the underlying connection (?)
// TODO: Tear down the underlying connection (?)
zmq_assert
(
written
);
if
(
!
written
)
{
errno
=
EAGAIN
;
return
-
1
;
}
}
}
else
{
else
{
...
@@ -186,6 +189,9 @@ int zmq::rep_t::xsend (zmq_msg_t *msg_, int flags_)
...
@@ -186,6 +189,9 @@ int zmq::rep_t::xsend (zmq_msg_t *msg_, int flags_)
zmq_msg_close
(
msg_
);
zmq_msg_close
(
msg_
);
}
}
// Check whether it's last part of the reply.
more
=
msg_
->
flags
&
ZMQ_MSG_MORE
;
// Flush the reply to the requester.
// Flush the reply to the requester.
if
(
!
more
)
{
if
(
!
more
)
{
reply_pipe
->
flush
();
reply_pipe
->
flush
();
...
...
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