Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
b56634e6
Commit
b56634e6
authored
Jul 29, 2015
by
Daniel Campora
Browse files
cc3200: On ssl.read() or ssl.readall() ignore ssl layer closed error.
parent
fb3f9cff
Changes
1
Hide whitespace changes
Inline
Side-by-side
cc3200/mods/modusocket.c
View file @
b56634e6
...
...
@@ -422,9 +422,15 @@ STATIC mp_uint_t socket_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *e
mod_network_socket_obj_t
*
self
=
self_in
;
mp_int_t
ret
=
wlan_socket_recv
(
self
,
buf
,
size
,
errcode
);
if
(
ret
<
0
)
{
ret
=
MP_STREAM_ERROR
;
// needed to convert simplelink's negative error codes to POSIX
(
*
errcode
)
*=
-
1
;
// we need to ignore the socket closed error here because a readall() or read() without params
// only returns when the socket is closed by the other end
if
(
*
errcode
!=
SL_ESECCLOSED
)
{
ret
=
MP_STREAM_ERROR
;
// needed to convert simplelink's negative error codes to POSIX
(
*
errcode
)
*=
-
1
;
}
else
{
ret
=
0
;
}
}
return
ret
;
}
...
...
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