File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -144,32 +144,47 @@ function records_mt:__len()
144144 return self .n
145145end
146146
147+ local record_ipv4_methods = {}
148+ local record_ipv4_mt = {
149+ __name = " http.client.record.ipv4" ;
150+ __index = record_ipv4_methods ;
151+ }
147152function records_methods :add_v4 (addr , port )
148153 local n = self .n + 1
149- self [n ] = {
154+ self [n ] = setmetatable ( {
150155 family = cs .AF_INET ;
151156 addr = addr ;
152157 port = port ;
153- }
158+ }, record_ipv4_mt )
154159 self .n = n
155160end
156161
162+ local record_ipv6_methods = {}
163+ local record_ipv6_mt = {
164+ __name = " http.client.record.ipv6" ;
165+ __index = record_ipv6_methods ;
166+ }
157167function records_methods :add_v6 (addr , port )
158168 local n = self .n + 1
159- self [n ] = {
169+ self [n ] = setmetatable ( {
160170 family = cs .AF_INET6 ;
161171 addr = addr ;
162172 port = port ;
163- }
173+ }, record_ipv6_mt )
164174 self .n = n
165175end
166176
177+ local record_unix_methods = {}
178+ local record_unix_mt = {
179+ __name = " http.client.record.unix" ;
180+ __index = record_unix_methods ;
181+ }
167182function records_methods :add_unix (path )
168183 local n = self .n + 1
169- self [n ] = {
184+ self [n ] = setmetatable ( {
170185 family = cs .AF_UNIX ;
171186 path = path ;
172- }
187+ }, record_unix_mt )
173188 self .n = n
174189end
175190
You can’t perform that action at this time.
0 commit comments