Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
promise
OpenXG-RAN
Commits
ed71e94d
Commit
ed71e94d
authored
Apr 26, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add size of message when forwarding (so the remote end can
skip unknown messages safely)
parent
06cd5665
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
common/utils/T/tracer/forward.c
common/utils/T/tracer/forward.c
+6
-3
common/utils/T/tracer/remote.c
common/utils/T/tracer/remote.c
+2
-0
No files found.
common/utils/T/tracer/forward.c
View file @
ed71e94d
...
...
@@ -150,15 +150,18 @@ again:
void
forward
(
void
*
_forwarder
,
char
*
buf
,
int
size
)
{
forward_data
*
f
=
_forwarder
;
int32_t
ssize
=
size
;
databuf
*
new
;
new
=
malloc
(
sizeof
(
*
new
));
if
(
new
==
NULL
)
abort
();
if
(
pthread_mutex_lock
(
&
f
->
datalock
))
abort
();
new
->
d
=
malloc
(
size
);
if
(
new
->
d
==
NULL
)
abort
();
memcpy
(
new
->
d
,
buf
,
size
);
new
->
l
=
size
;
new
->
d
=
malloc
(
size
+
4
);
if
(
new
->
d
==
NULL
)
abort
();
/* put the size of the message at the head */
memcpy
(
new
->
d
,
&
ssize
,
4
);
memcpy
(
new
->
d
+
4
,
buf
,
size
);
new
->
l
=
size
+
4
;
new
->
next
=
NULL
;
if
(
f
->
head
==
NULL
)
f
->
head
=
new
;
if
(
f
->
tail
!=
NULL
)
f
->
tail
->
next
=
new
;
...
...
common/utils/T/tracer/remote.c
View file @
ed71e94d
...
...
@@ -91,7 +91,9 @@ void get_message(int s)
printf("["x"]["y"] %s", str); \
} while (0)
int32_t
size
;
int
m
;
if
(
GET
(
s
,
&
size
,
4
)
!=
4
)
abort
();
if
(
GET
(
s
,
&
m
,
sizeof
(
int
))
!=
sizeof
(
int
))
abort
();
switch
(
m
)
{
case
T_first
:
{
...
...
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