Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
14b8ff89
authored
Mar 23, 2016
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network_cpp: only send complete result messages
parent
253edaf2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c
+22
-15
No files found.
mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c
View file @
14b8ff89
...
...
@@ -144,33 +144,40 @@ static void embb_mtapi_network_task_complete(
embb_mutex_lock
(
&
plugin
->
send_mutex
);
embb_mtapi_network_buffer_clear
(
send_buf
);
// actual counts bytes actually put into the buffer
int
actual
=
0
;
// expected counts bytes we intended to put into the buffer
int
expected
=
0
;
// operation is "return result"
err
=
embb_mtapi_network_buffer_push_back_int8
(
actual
+
=
embb_mtapi_network_buffer_push_back_int8
(
send_buf
,
EMBB_MTAPI_NETWORK_RETURN_RESULT
);
assert
(
err
==
1
)
;
expected
+=
1
;
// remote task id
err
=
embb_mtapi_network_buffer_push_back_int32
(
actual
+
=
embb_mtapi_network_buffer_push_back_int32
(
send_buf
,
network_task
->
remote_task_id
);
assert
(
err
==
4
)
;
err
=
embb_mtapi_network_buffer_push_back_int32
(
expected
+=
4
;
actual
+
=
embb_mtapi_network_buffer_push_back_int32
(
send_buf
,
network_task
->
remote_task_tag
);
assert
(
err
==
4
)
;
expected
+=
4
;
// status
err
=
embb_mtapi_network_buffer_push_back_int32
(
actual
+
=
embb_mtapi_network_buffer_push_back_int32
(
send_buf
,
local_task
->
error_code
);
assert
(
err
==
4
)
;
expected
+=
4
;
// result size
err
=
embb_mtapi_network_buffer_push_back_int32
(
actual
+
=
embb_mtapi_network_buffer_push_back_int32
(
send_buf
,
(
int32_t
)
local_task
->
result_size
);
assert
(
err
==
4
)
;
err
=
embb_mtapi_network_buffer_push_back_rawdata
(
expected
+=
4
;
actual
+
=
embb_mtapi_network_buffer_push_back_rawdata
(
send_buf
,
(
int32_t
)
local_task
->
result_size
,
local_task
->
result_buffer
);
assert
(
err
==
(
int
)
local_task
->
result_size
)
;
expected
+=
(
int
)
local_task
->
result_size
;
err
=
embb_mtapi_network_socket_sendbuffer
(
&
network_task
->
socket
,
send_buf
);
assert
(
err
==
send_buf
->
size
);
if
(
expected
==
actual
)
{
int
sent
=
embb_mtapi_network_socket_sendbuffer
(
&
network_task
->
socket
,
send_buf
);
assert
(
sent
==
send_buf
->
size
);
}
// sending done
embb_mutex_unlock
(
&
plugin
->
send_mutex
);
...
...
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