Skip to content

Commit fa6b730

Browse files
committed
Fix embarrassing variable scope errors
1 parent 0fbe7ec commit fa6b730

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/resty/http.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,15 +1111,18 @@ function _M.proxy_response(_, response, chunksize)
11111111
end
11121112

11131113
local reader = response.body_reader
1114+
11141115
repeat
1115-
local chunk, read_err = reader(chunksize)
1116-
if err then
1116+
local chunk, ok, read_err, print_err
1117+
1118+
chunk, read_err = reader(chunksize)
1119+
if read_err then
11171120
ngx_log(ngx_ERR, read_err)
11181121
end
11191122

11201123
if chunk then
1121-
local res, print_err = ngx_print(chunk)
1122-
if not res then
1124+
ok, print_err = ngx_print(chunk)
1125+
if not ok then
11231126
ngx_log(ngx_ERR, print_err)
11241127
end
11251128
end

0 commit comments

Comments
 (0)