Skip to content

Commit 8676dc0

Browse files
committed
Update doc.
1 parent e7712b9 commit 8676dc0

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

doc/lcurl.ldoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ function easy() end
2424
--
2525
-- @tparam[opt] table options
2626
-- @treturn[1] multi new curl multi object
27+
--
28+
-- @usage
29+
-- m = curl.multi{
30+
-- socketfunction = handle_socket;
31+
-- timerfunction = start_timeout;
32+
-- }
33+
--
2734
function multi() end
2835

2936
--- Create Share object
@@ -433,6 +440,18 @@ function info_read() end
433440
-- c:setopt{maxconnects = 10}
434441
function setopt() end
435442

443+
--- Perform socket action.
444+
--
445+
-- @tparam[opt=curl.SOCKET_TIMEOUT] number socket
446+
-- @tparam[opt=0] number mask
447+
-- @treturn multi self
448+
--
449+
-- @usage
450+
-- c:socket_action()
451+
-- c:socket_action(sock_fd, curl.CSELECT_IN)
452+
-- c:socket_action(sock_fd, curl.CSELECT_OUT)
453+
function socket_action() end
454+
436455
--- Set timer callback.
437456
--
438457
-- @tparam function timer timer callback

src/lcmulti.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static int lcurl_multi_socket_action(lua_State *L){
231231
lcurl_multi_t *p = lcurl_getmulti(L);
232232
curl_socket_t s = lutil_optint64(L, 2, CURL_SOCKET_TIMEOUT);
233233
CURLMcode code; int n, mask;
234-
if(s == CURL_SOCKET_TIMEOUT) mask = 0;
234+
if(s == CURL_SOCKET_TIMEOUT) mask = lutil_optint64(L, 3, 0);
235235
else mask = lutil_checkint64(L, 3);
236236
code = curl_multi_socket_action(p->curl, s, mask, &n);
237237
if(code != CURLM_OK){

0 commit comments

Comments
 (0)