完善节点筛选机制
This commit is contained in:
@@ -40,6 +40,10 @@ type channelServer struct {
|
||||
}
|
||||
|
||||
func (s *channelServer) CreateChannels(source netip.Addr, resourceNo string, authWhitelist bool, authPassword bool, count int, edgeFilter *EdgeFilter) ([]*m.Channel, error) {
|
||||
if edgeFilter == nil {
|
||||
edgeFilter = &EdgeFilter{}
|
||||
}
|
||||
|
||||
var area *m.Area
|
||||
if edgeFilter.AreaID != nil {
|
||||
var err error
|
||||
@@ -265,8 +269,8 @@ func persistChannelCreate(ctx *channelCreateContext, channels []*m.Channel) erro
|
||||
BatchNo: ctx.BatchNo,
|
||||
Count: int32(ctx.Count),
|
||||
ISP: u.X(ctx.Filter.Isp.String()),
|
||||
Prov: prov,
|
||||
City: city,
|
||||
Prov: u.Ternary(ctx.Filter.AreaID != nil, prov, nil),
|
||||
City: u.Ternary(ctx.Filter.AreaID != nil, city, nil),
|
||||
IP: orm.Inet{Addr: ctx.Source},
|
||||
Time: ctx.Now,
|
||||
}); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user