mirror of
https://github.com/abh/geodns.git
synced 2026-04-27 03:45:53 +03:00
[GH-ISSUE #32] findLabel and the selector #26
Labels
No labels
bug
bug
enhancement
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/geodns#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @miekg on GitHub (Mar 9, 2013).
Original GitHub issue: https://github.com/abh/geodns/issues/32
The
selectorin findLabel generates garbage. It would be beter to completely remove this from this (often called) function.@abh commented on GitHub (Mar 10, 2013):
On Mar 8, 2013, at 23:46, Miek Gieben notifications@github.com wrote:
Using the new data structure we've talked about should fix that.
It's interesting (but makes sense) that "creating garbage" is a significant overhead. The things you pointed out also explains, I think, how the 32-bit servers ran out of memory so quickly when the query rate went way up.
Ask
@abh commented on GitHub (Nov 4, 2013):
Since you made this ticket I've dug myself deeper in, rather than working towards getting rid of it. Can you outline what you had in my for getting rid of it? Currently the code making the list of "targets" is in "GetTargets()" in targeting.go and serve.go passes that list to findLabels that then just iterates over it.
@miekg commented on GitHub (Nov 4, 2013):
[ Quoting notifications@github.com in "Re: [geodns] findLabel and the sele..." ]
Thought I mentioned it, because of the string var 'name', which probably
isn't a real big issue. The following patch captures what I had in mind
to change it. Note: untested! Only thing going for it, is that it
compiles.
grtz Miek
@@ -125,23 +125,30 @@ func (z _Zone) SoaRR() dns.RR {
// first available qType at each targeting level. Return a Label
// and the qtype that was "found"
func (z *Zone) findLabels(s string, targets []string, qts qTypes) (_Label, uint16) {
+}
- for _, target := range targets {
switch target {
case "@":
@@ -153,9 +160,7 @@ func (z _Zone) findLabels(s string, targets []string, qts qTypes) (_Label, uint1
return z.Labels[s], qtype
case dns.TypeMF:
if label.Records[dns.TypeMF] != nil {