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
9 years ago
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network_cpp: only send complete result messages
parent
253edaf2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
mtapi_plugins_c/mtapi_network_c/src/embb_mtapi_network.c
+21
-14
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(
...
@@ -144,33 +144,40 @@ static void embb_mtapi_network_task_complete(
embb_mutex_lock
(
&
plugin
->
send_mutex
);
embb_mutex_lock
(
&
plugin
->
send_mutex
);
embb_mtapi_network_buffer_clear
(
send_buf
);
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"
// 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
);
send_buf
,
EMBB_MTAPI_NETWORK_RETURN_RESULT
);
assert
(
err
==
1
)
;
expected
+=
1
;
// remote task id
// 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
);
send_buf
,
network_task
->
remote_task_id
);
assert
(
err
==
4
)
;
expected
+=
4
;
err
=
embb_mtapi_network_buffer_push_back_int32
(
actual
+
=
embb_mtapi_network_buffer_push_back_int32
(
send_buf
,
network_task
->
remote_task_tag
);
send_buf
,
network_task
->
remote_task_tag
);
assert
(
err
==
4
)
;
expected
+=
4
;
// status
// status
err
=
embb_mtapi_network_buffer_push_back_int32
(
actual
+
=
embb_mtapi_network_buffer_push_back_int32
(
send_buf
,
local_task
->
error_code
);
send_buf
,
local_task
->
error_code
);
assert
(
err
==
4
)
;
expected
+=
4
;
// result size
// 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
);
send_buf
,
(
int32_t
)
local_task
->
result_size
);
assert
(
err
==
4
)
;
expected
+=
4
;
err
=
embb_mtapi_network_buffer_push_back_rawdata
(
actual
+
=
embb_mtapi_network_buffer_push_back_rawdata
(
send_buf
,
(
int32_t
)
local_task
->
result_size
,
send_buf
,
(
int32_t
)
local_task
->
result_size
,
local_task
->
result_buffer
);
local_task
->
result_buffer
);
assert
(
err
==
(
int
)
local_task
->
result_size
)
;
expected
+=
(
int
)
local_task
->
result_size
;
err
=
embb_mtapi_network_socket_sendbuffer
(
if
(
expected
==
actual
)
{
int
sent
=
embb_mtapi_network_socket_sendbuffer
(
&
network_task
->
socket
,
send_buf
);
&
network_task
->
socket
,
send_buf
);
assert
(
err
==
send_buf
->
size
);
assert
(
sent
==
send_buf
->
size
);
}
// sending done
// sending done
embb_mutex_unlock
(
&
plugin
->
send_mutex
);
embb_mutex_unlock
(
&
plugin
->
send_mutex
);
...
...
This diff is collapsed.
Click to expand it.
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