Skip to content

Commit b017805

Browse files
committed
Merge branch 'set_timeouts' of https://github.com/alubbe/lua-resty-http into alubbe-set_timeouts
2 parents a7aee5b + cd56e5a commit b017805

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/resty/http.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ function _M.set_timeout(self, timeout)
115115
end
116116

117117

118+
function _M.set_timeouts(self, connect_timeout, send_timeout, read_timeout)
119+
local sock = self.sock
120+
if not sock then
121+
return nil, "not initialized"
122+
end
123+
124+
return sock:settimeouts(connect_timeout, send_timeout, read_timeout)
125+
end
126+
127+
118128
function _M.ssl_handshake(self, ...)
119129
local sock = self.sock
120130
if not sock then

0 commit comments

Comments
 (0)