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
8fba0f47
Commit
8fba0f47
authored
Oct 15, 2015
by
Johny Mattsson
Browse files
Make UDP server work again after 1.4.0 API changes.
parent
afdd9430
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/net.c
View file @
8fba0f47
...
@@ -1077,6 +1077,16 @@ static int net_send( lua_State* L, const char* mt )
...
@@ -1077,6 +1077,16 @@ static int net_send( lua_State* L, const char* mt )
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
nud
->
cb_send_ref
);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
nud
->
cb_send_ref
);
nud
->
cb_send_ref
=
luaL_ref
(
L
,
LUA_REGISTRYINDEX
);
nud
->
cb_send_ref
=
luaL_ref
(
L
,
LUA_REGISTRYINDEX
);
}
}
// SDK 1.4.0 changed behaviour, for UDP server need to look up remote ip/port
if
(
isserver
&&
pesp_conn
->
type
==
ESPCONN_UDP
)
{
remot_info
*
pr
=
0
;
if
(
espconn_get_connection_info
(
pesp_conn
,
&
pr
,
0
)
!=
ESPCONN_OK
)
return
luaL_error
(
L
,
"remote ip/port unavailable"
);
pesp_conn
->
proto
.
udp
->
remote_port
=
pr
->
remote_port
;
os_memmove
(
pesp_conn
->
proto
.
udp
->
remote_ip
,
pr
->
remote_ip
,
4
);
// The remot_info apparently should *not* be os_free()d, fyi
}
#ifdef CLIENT_SSL_ENABLE
#ifdef CLIENT_SSL_ENABLE
if
(
nud
->
secure
)
if
(
nud
->
secure
)
espconn_secure_sent
(
pesp_conn
,
(
unsigned
char
*
)
payload
,
l
);
espconn_secure_sent
(
pesp_conn
,
(
unsigned
char
*
)
payload
,
l
);
...
...
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