File tree Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Expand file tree Collapse file tree 1 file changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -144,47 +144,42 @@ function records_mt:__len()
144144 return self .n
145145end
146146
147- local record_ipv4_methods = {}
147+ local record_ipv4_methods = {
148+ family = cs .AF_INET ;
149+ }
148150local record_ipv4_mt = {
149151 __name = " http.client.record.ipv4" ;
150152 __index = record_ipv4_methods ;
151153}
152154function records_methods :add_v4 (addr , port )
153155 local n = self .n + 1
154- self [n ] = setmetatable ({
155- family = cs .AF_INET ;
156- addr = addr ;
157- port = port ;
158- }, record_ipv4_mt )
156+ self [n ] = setmetatable ({ addr = addr , port = port }, record_ipv4_mt )
159157 self .n = n
160158end
161159
162- local record_ipv6_methods = {}
160+ local record_ipv6_methods = {
161+ family = cs .AF_INET6 ;
162+ }
163163local record_ipv6_mt = {
164164 __name = " http.client.record.ipv6" ;
165165 __index = record_ipv6_methods ;
166166}
167167function records_methods :add_v6 (addr , port )
168168 local n = self .n + 1
169- self [n ] = setmetatable ({
170- family = cs .AF_INET6 ;
171- addr = addr ;
172- port = port ;
173- }, record_ipv6_mt )
169+ self [n ] = setmetatable ({ addr = addr , port = port }, record_ipv6_mt )
174170 self .n = n
175171end
176172
177- local record_unix_methods = {}
173+ local record_unix_methods = {
174+ family = cs .AF_UNIX ;
175+ }
178176local record_unix_mt = {
179177 __name = " http.client.record.unix" ;
180178 __index = record_unix_methods ;
181179}
182180function records_methods :add_unix (path )
183181 local n = self .n + 1
184- self [n ] = setmetatable ({
185- family = cs .AF_UNIX ;
186- path = path ;
187- }, record_unix_mt )
182+ self [n ] = setmetatable ({ path = path }, record_unix_mt )
188183 self .n = n
189184end
190185
You can’t perform that action at this time.
0 commit comments