Skip to content

Commit 9a1270f

Browse files
committed
Fix. curl_multi_socket_action may invoke easy callbacks before socket callback.
1 parent a836734 commit 9a1270f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lcmulti.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int lcurl_multi_socket_action(lua_State *L){
311311
if(s == CURL_SOCKET_TIMEOUT) mask = lutil_optint64(L, 3, 0);
312312
else mask = lutil_checkint64(L, 3);
313313

314-
lcurl__multi_assign_lua(L, p, 0);
314+
lcurl__multi_assign_lua(L, p, 1);
315315
code = curl_multi_socket_action(p->curl, s, mask, &n);
316316
p->L = NULL;
317317

@@ -470,7 +470,6 @@ static int lcurl_multi_socket_callback(CURL *easy, curl_socket_t s, int what, vo
470470
lutil_pushint64(L, s);
471471
lua_pushinteger(L, what);
472472

473-
e->L = L;
474473
if(lua_pcall(L, n+2, 0, 0)){
475474
assert(lua_gettop(L) >= top);
476475
lua_settop(L, top);

0 commit comments

Comments
 (0)