File tree 1 file changed +21
-6
lines changed
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()
144
144
return self .n
145
145
end
146
146
147
+ local record_ipv4_methods = {}
148
+ local record_ipv4_mt = {
149
+ __name = " http.client.record.ipv4" ;
150
+ __index = record_ipv4_methods ;
151
+ }
147
152
function records_methods :add_v4 (addr , port )
148
153
local n = self .n + 1
149
- self [n ] = {
154
+ self [n ] = setmetatable ( {
150
155
family = cs .AF_INET ;
151
156
addr = addr ;
152
157
port = port ;
153
- }
158
+ }, record_ipv4_mt )
154
159
self .n = n
155
160
end
156
161
162
+ local record_ipv6_methods = {}
163
+ local record_ipv6_mt = {
164
+ __name = " http.client.record.ipv6" ;
165
+ __index = record_ipv6_methods ;
166
+ }
157
167
function records_methods :add_v6 (addr , port )
158
168
local n = self .n + 1
159
- self [n ] = {
169
+ self [n ] = setmetatable ( {
160
170
family = cs .AF_INET6 ;
161
171
addr = addr ;
162
172
port = port ;
163
- }
173
+ }, record_ipv6_mt )
164
174
self .n = n
165
175
end
166
176
177
+ local record_unix_methods = {}
178
+ local record_unix_mt = {
179
+ __name = " http.client.record.unix" ;
180
+ __index = record_unix_methods ;
181
+ }
167
182
function records_methods :add_unix (path )
168
183
local n = self .n + 1
169
- self [n ] = {
184
+ self [n ] = setmetatable ( {
170
185
family = cs .AF_UNIX ;
171
186
path = path ;
172
- }
187
+ }, record_unix_mt )
173
188
self .n = n
174
189
end
175
190
You can’t perform that action at this time.
0 commit comments