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
9cee8f9c
Commit
9cee8f9c
authored
Feb 02, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
problem with PGM messages larger than 1 MTU fixed
parent
27e47bdc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
pgm_receiver.cpp
src/pgm_receiver.cpp
+10
-6
No files found.
src/pgm_receiver.cpp
View file @
9cee8f9c
...
@@ -93,12 +93,18 @@ void zmq::pgm_receiver_t::in_event ()
...
@@ -93,12 +93,18 @@ void zmq::pgm_receiver_t::in_event ()
// Read data from the underlying pgm_socket.
// Read data from the underlying pgm_socket.
unsigned
char
*
data
=
NULL
;
unsigned
char
*
data
=
NULL
;
const
pgm_tsi_t
*
tsi
=
NULL
;
const
pgm_tsi_t
*
tsi
=
NULL
;
// TODO: This loop can effectively block other engines in the same I/O
// thread in the case of high load.
while
(
true
)
{
// Get new batch of data.
ssize_t
received
=
pgm_socket
.
receive
((
void
**
)
&
data
,
&
tsi
);
ssize_t
received
=
pgm_socket
.
receive
((
void
**
)
&
data
,
&
tsi
);
// No data to process. This may happen if the packet received is
// No data to process. This may happen if the packet received is
// neither ODATA nor ODATA.
// neither ODATA nor ODATA.
if
(
received
==
0
)
if
(
received
==
0
)
return
;
break
;
// Find the peer based on its TSI.
// Find the peer based on its TSI.
peers_t
::
iterator
it
=
peers
.
find
(
*
tsi
);
peers_t
::
iterator
it
=
peers
.
find
(
*
tsi
);
...
@@ -111,7 +117,7 @@ void zmq::pgm_receiver_t::in_event ()
...
@@ -111,7 +117,7 @@ void zmq::pgm_receiver_t::in_event ()
delete
it
->
second
.
decoder
;
delete
it
->
second
.
decoder
;
it
->
second
.
decoder
=
NULL
;
it
->
second
.
decoder
=
NULL
;
}
}
return
;
break
;
}
}
// New peer. Add it to the list of know but unjoint peers.
// New peer. Add it to the list of know but unjoint peers.
...
@@ -132,7 +138,7 @@ void zmq::pgm_receiver_t::in_event ()
...
@@ -132,7 +138,7 @@ void zmq::pgm_receiver_t::in_event ()
// There is no beginning of the message in current packet.
// There is no beginning of the message in current packet.
// Ignore the data.
// Ignore the data.
if
(
offset
==
0xffff
)
if
(
offset
==
0xffff
)
return
;
continue
;
zmq_assert
(
offset
<=
received
);
zmq_assert
(
offset
<=
received
);
zmq_assert
(
it
->
second
.
decoder
==
NULL
);
zmq_assert
(
it
->
second
.
decoder
==
NULL
);
...
@@ -149,16 +155,14 @@ void zmq::pgm_receiver_t::in_event ()
...
@@ -149,16 +155,14 @@ void zmq::pgm_receiver_t::in_event ()
it
->
second
.
decoder
->
set_inout
(
inout
);
it
->
second
.
decoder
->
set_inout
(
inout
);
}
}
if
(
received
)
{
// Push all the data to the decoder.
// Push all the data to the decoder.
// TODO: process_buffer may not process entire buffer!
// TODO: process_buffer may not process entire buffer!
ssize_t
processed
=
it
->
second
.
decoder
->
process_buffer
(
data
,
received
);
ssize_t
processed
=
it
->
second
.
decoder
->
process_buffer
(
data
,
received
);
zmq_assert
(
processed
==
received
);
zmq_assert
(
processed
==
received
);
}
// Flush any messages decoder may have produced.
// Flush any messages decoder may have produced.
inout
->
flush
();
inout
->
flush
();
}
}
}
#endif
#endif
...
...
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