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
80e8baaf
Commit
80e8baaf
authored
May 08, 2012
by
Ian Barber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #337 from hurtonm/issue_268
Fix issue #268
parents
5dc44a63
3d93c1af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
encoder.cpp
src/encoder.cpp
+3
-5
encoder.hpp
src/encoder.hpp
+6
-8
No files found.
src/encoder.cpp
View file @
80e8baaf
...
...
@@ -51,7 +51,7 @@ bool zmq::encoder_t::size_ready ()
{
// Write message body into the buffer.
next_step
(
in_progress
.
data
(),
in_progress
.
size
(),
&
encoder_t
::
message_ready
,
false
);
&
encoder_t
::
message_ready
,
!
(
in_progress
.
flags
()
&
msg_t
::
more
)
);
return
true
;
}
...
...
@@ -90,15 +90,13 @@ bool zmq::encoder_t::message_ready ()
if
(
size
<
255
)
{
tmpbuf
[
0
]
=
(
unsigned
char
)
size
;
tmpbuf
[
1
]
=
(
in_progress
.
flags
()
&
msg_t
::
more
);
next_step
(
tmpbuf
,
2
,
&
encoder_t
::
size_ready
,
!
(
in_progress
.
flags
()
&
msg_t
::
more
));
next_step
(
tmpbuf
,
2
,
&
encoder_t
::
size_ready
,
false
);
}
else
{
tmpbuf
[
0
]
=
0xff
;
put_uint64
(
tmpbuf
+
1
,
size
);
tmpbuf
[
9
]
=
(
in_progress
.
flags
()
&
msg_t
::
more
);
next_step
(
tmpbuf
,
10
,
&
encoder_t
::
size_ready
,
!
(
in_progress
.
flags
()
&
msg_t
::
more
));
next_step
(
tmpbuf
,
10
,
&
encoder_t
::
size_ready
,
false
);
}
return
true
;
}
src/encoder.hpp
View file @
80e8baaf
...
...
@@ -79,19 +79,17 @@ namespace zmq
// If there are still no data, return what we already have
// in the buffer.
if
(
!
to_write
)
{
// If we are to encode the beginning of a new message,
// adjust the message offset.
if
(
beginning
)
if
(
offset_
&&
*
offset_
==
-
1
)
*
offset_
=
static_cast
<
int
>
(
pos
);
if
(
!
(
static_cast
<
T
*>
(
this
)
->*
next
)
())
{
*
data_
=
buffer
;
*
size_
=
pos
;
return
;
}
// If beginning of the message was processed, adjust the
// first-message-offset.
if
(
beginning
)
{
if
(
offset_
&&
*
offset_
==
-
1
)
*
offset_
=
(
int
)
pos
;
beginning
=
false
;
}
}
// If there are no data in the buffer yet and we are able to
...
...
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