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