Software /
code /
prosody
Comparison
net/http/parser.lua @ 10540:375d31225d53
net.http.parser: Silence warning about unused variable [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 23 Dec 2019 21:29:34 +0100 |
parent | 8045:55a56dc935f2 |
child | 10580:b7c5d7bae4ef |
comparison
equal
deleted
inserted
replaced
10539:25f80afb1631 | 10540:375d31225d53 |
---|---|
61 while buflen > 0 do | 61 while buflen > 0 do |
62 if state == nil then -- read request | 62 if state == nil then -- read request |
63 if buftable then buf, buftable = t_concat(buf), false; end | 63 if buftable then buf, buftable = t_concat(buf), false; end |
64 local index = buf:find("\r\n\r\n", nil, true); | 64 local index = buf:find("\r\n\r\n", nil, true); |
65 if not index then return; end -- not enough data | 65 if not index then return; end -- not enough data |
66 local method, path, httpversion, status_code, reason_phrase; | 66 -- FIXME was reason_phrase meant to be passed on somewhere? |
67 local method, path, httpversion, status_code, reason_phrase; -- luacheck: ignore reason_phrase | |
67 local first_line; | 68 local first_line; |
68 local headers = {}; | 69 local headers = {}; |
69 for line in buf:sub(1,index+1):gmatch("([^\r\n]+)\r\n") do -- parse request | 70 for line in buf:sub(1,index+1):gmatch("([^\r\n]+)\r\n") do -- parse request |
70 if first_line then | 71 if first_line then |
71 local key, val = line:match("^([^%s:]+): *(.*)$"); | 72 local key, val = line:match("^([^%s:]+): *(.*)$"); |