Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Accelerator Control System
epics-support
mcan
Commits
617b297e
Commit
617b297e
authored
Dec 05, 2019
by
Franksen, Benjamin
Browse files
scan/ellsi: passing MSG_WAITALL has no effect for UDP
parent
e50377d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
MultiCAN/src/drivers/scan/ellsi.c
View file @
617b297e
...
...
@@ -226,16 +226,17 @@ static ssize_t ellsi_read(void *pvt, struct can_frame *frame) {
ellsiCanTelegram
*
this
;
while
(
state
->
unread
==
0
)
{
nbytes
=
recv
(
state
->
sock
,
&
state
->
msg
,
sizeof
(
state
->
msg
),
MSG_WAITALL
);
debug
(
"ellsi_read: got cmd %d subcmd %d more bytes %d
\n
"
,
ntohl
(
state
->
msg
.
header
.
command
),
ntohl
(
state
->
msg
.
header
.
subcommand
),
ntohl
(
state
->
msg
.
header
.
payloadLen
));
nbytes
=
recv
(
state
->
sock
,
&
state
->
msg
,
sizeof
(
state
->
msg
),
0
);
if
(
nbytes
<
0
)
{
errbuf_t
buf
;
fprintf
(
stderr
,
"ellsi_read: recv failed (%s)
\n
"
,
ERRNO_STR
(
buf
));
fprintf
(
stderr
,
"ellsi_read
(%d)
: recv failed (%s)
\n
"
,
state
->
sock
,
ERRNO_STR
(
buf
));
return
-
1
;
}
debug
(
"ellsi_read(%d): got cmd %d subcmd %d paylod length %d
\n
"
,
state
->
sock
,
ntohl
(
state
->
msg
.
header
.
command
),
ntohl
(
state
->
msg
.
header
.
subcommand
),
ntohl
(
state
->
msg
.
header
.
payloadLen
));
if
(
state
->
msg
.
header
.
magic
!=
htonl
(
ELLSI_MAGIC
))
{
fprintf
(
stderr
,
"ellsi_read(%d): bad magic
\n
"
,
state
->
sock
);
return
-
1
;
...
...
@@ -302,7 +303,7 @@ static int ellsi_check(int sock) {
int
r
;
memset
(
&
ack
,
0
,
sizeof
(
ack
));
r
=
recv
(
sock
,
&
ack
,
sizeof
(
ack
),
MSG_WAITALL
);
r
=
recv
(
sock
,
&
ack
,
sizeof
(
ack
),
0
);
if
(
r
<
0
)
{
if
(
errno
!=
EAGAIN
&&
errno
!=
EWOULDBLOCK
)
{
errbuf_t
buf
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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