aboutsummaryrefslogtreecommitdiff
path: root/plugin/hosts/hostsfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/hosts/hostsfile.go')
-rw-r--r--plugin/hosts/hostsfile.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugin/hosts/hostsfile.go b/plugin/hosts/hostsfile.go
index 4b912b17c..1d87f82f7 100644
--- a/plugin/hosts/hostsfile.go
+++ b/plugin/hosts/hostsfile.go
@@ -54,6 +54,22 @@ func newHostsMap() *hostsMap {
}
}
+// Len returns the total number of addresses in the hostmap, this includes
+// V4/V6 and any reverse addresses.
+func (h *hostsMap) Len() int {
+ l := 0
+ for _, v4 := range h.byNameV4 {
+ l += len(v4)
+ }
+ for _, v6 := range h.byNameV6 {
+ l += len(v6)
+ }
+ for _, a := range h.byAddr {
+ l += len(a)
+ }
+ return l
+}
+
// Hostsfile contains known host entries.
type Hostsfile struct {
sync.RWMutex
@@ -111,6 +127,8 @@ func (h *Hostsfile) initInline(inline []string) {
func (h *Hostsfile) parseReader(r io.Reader) {
h.hmap = h.parse(r, h.inline)
+
+ log.Debugf("Parsed hosts file into %d entries", h.hmap.Len())
}
// Parse reads the hostsfile and populates the byName and byAddr maps.
solation Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/path.test.js (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-03-23[bun.js] Implement Bun.write()Gravatar Jarred SUmner 11-63/+959
2022-03-22Handle integer sizes greater than i32Gravatar Jarred SUmner 14-74/+142
2022-03-22Linux-specific tweaksGravatar Jarred SUmner 6-43/+52
2022-03-22`Response.file` -> `Bun.file`Gravatar Jarred Sumner 3-72/+65
2022-03-21sendfile worksGravatar Jarred Sumner 7-62/+174
2022-03-21[bun.js] 2/? Implement `Response.file`, sendfile editionGravatar Jarred Sumner 8-161/+506
2022-03-21[bun.js] 1/? Implement `Response.file`Gravatar Jarred Sumner 13-103/+1103