Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 795cbc4

Browse files
Parse and apply rrSpreadCount (position 61) in CLI
1 parent 3fe280c commit 795cbc4

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎cli/main.go‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ type Profile struct {
109109
// Multi-resolver mode (config position 60): "fanout" or "roundrobin"
110110
ResolverMode string
111111

112+
// Round-robin spread count (config position 61): how many resolvers per query in fast mode
113+
RRSpreadCount int
114+
112115
// Locked profile (config position 31)
113116
IsLocked bool
114117
}
@@ -286,6 +289,13 @@ func parseURI(uri string) (*Profile, error) {
286289
p.ResolverMode = fields[60]
287290
}
288291

292+
// RR spread count (position 61)
293+
if len(fields) > 61 {
294+
if v, err := strconv.Atoi(fields[61]); err == nil && v >= 1 {
295+
p.RRSpreadCount = v
296+
}
297+
}
298+
289299
return p, nil
290300
}
291301

@@ -818,6 +828,9 @@ func connectWithParams(uri string, portOverride int, hostOverride string, dnsOve
818828
if rMode != "" {
819829
c.SetResolverMode(rMode)
820830
}
831+
if profile.RRSpreadCount > 0 {
832+
c.SetRRSpreadCount(int64(profile.RRSpreadCount))
833+
}
821834
return c, nil
822835
}
823836

@@ -858,6 +871,9 @@ func connectWithParams(uri string, portOverride int, hostOverride string, dnsOve
858871
if rMode != "" {
859872
c.SetResolverMode(rMode)
860873
}
874+
if profile.RRSpreadCount > 0 {
875+
c.SetRRSpreadCount(int64(profile.RRSpreadCount))
876+
}
861877
return c, nil
862878
}
863879

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /