Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
f501b840
Commit
f501b840
authored
Jul 21, 2017
by
devsaurus
Browse files
signal an error in case TCP send data was only written partly
parent
d26c8ea2
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/modules/net.c
View file @
f501b840
...
...
@@ -650,6 +650,11 @@ int net_send( lua_State *L ) {
}
else
if
(
ud
->
type
==
TYPE_TCP_CLIENT
)
{
size_t
bytes_written
;
err
=
netconn_write_partly
(
ud
->
netconn
,
data
,
datalen
,
NETCONN_COPY
,
&
bytes_written
);
if
(
err
==
ERR_OK
&&
(
datalen
!=
bytes_written
))
{
// the string object is potentially gc'ed after net_send finishes and we can't ensure
// integrity of the data pointer to netconn -> signal error to Lua layer
err
=
ERR_BUF
;
}
}
else
{
err
=
ERR_VAL
;
...
...
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