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
fd68000c
Commit
fd68000c
authored
Apr 05, 2020
by
Nathaniel Wesley Filardo
Committed by
Marcel Stör
Jun 09, 2020
Browse files
net: drop LUA_GCSTOP/GCRESTART dance
parent
bf478e0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/modules/net.c
View file @
fd68000c
...
...
@@ -142,10 +142,9 @@ static void net_err_cb(void *arg, err_t err) {
lua_call
(
L
,
2
,
0
);
}
if
(
ud
->
client
.
wait_dns
==
0
)
{
lua_gc
(
L
,
LUA_GCSTOP
,
0
);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
self_ref
);
int
selfref
=
ud
->
self_ref
;
ud
->
self_ref
=
LUA_NOREF
;
lua
_gc
(
L
,
LUA_
GCRESTART
,
0
);
lua
L_unref
(
L
,
LUA_
REGISTRYINDEX
,
selfref
);
}
}
...
...
@@ -189,10 +188,9 @@ static void net_dns_cb(const char *name, ip_addr_t *ipaddr, void *arg) {
if
(
ud
->
pcb
&&
ud
->
type
==
TYPE_TCP_CLIENT
&&
ud
->
tcp_pcb
->
state
==
CLOSED
)
{
tcp_connect
(
ud
->
tcp_pcb
,
&
addr
,
ud
->
tcp_pcb
->
remote_port
,
net_connected_cb
);
}
else
if
(
!
ud
->
pcb
&&
ud
->
client
.
wait_dns
==
0
)
{
lua_gc
(
L
,
LUA_GCSTOP
,
0
);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
self_ref
);
int
selfref
=
ud
->
self_ref
;
ud
->
self_ref
=
LUA_NOREF
;
lua
_gc
(
L
,
LUA_
GCRESTART
,
0
);
lua
L_unref
(
L
,
LUA_
REGISTRYINDEX
,
selfref
);
}
}
...
...
@@ -742,10 +740,10 @@ int net_close( lua_State *L ) {
}
if
(
ud
->
type
==
TYPE_TCP_SERVER
||
(
ud
->
pcb
==
NULL
&&
ud
->
client
.
wait_dns
==
0
))
{
// lua_gc(L, LUA_GCSTOP, 0);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
self_ref
)
;
int
selfref
=
ud
->
self_ref
;
ud
->
self_ref
=
LUA_NOREF
;
//
lua
_gc
(L, LUA_
GCRESTART, 0
);
lua
L_unref
(
L
,
LUA_
REGISTRYINDEX
,
selfref
);
}
#if 0
dbg_print_ud("close exit", ud);
...
...
@@ -794,10 +792,10 @@ int net_delete( lua_State *L ) {
ud
->
server
.
cb_accept_ref
=
LUA_NOREF
;
break
;
}
// lua_gc(L, LUA_GCSTOP, 0);
luaL_unref
(
L
,
LUA_REGISTRYINDEX
,
ud
->
self_ref
)
;
int
selfref
=
ud
->
self_ref
;
ud
->
self_ref
=
LUA_NOREF
;
//
lua
_gc
(L, LUA_
GCRESTART, 0
);
lua
L_unref
(
L
,
LUA_
REGISTRYINDEX
,
selfref
);
#if 0
dbg_print_ud("delete end", ud);
#endif
...
...
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