MCPcopy Index your code
hub / github.com/coredns/coredns / parseDOH3

Function parseDOH3

plugin/https3/setup.go:26–63  ·  view source on GitHub ↗
(c *caddy.Controller)

Source from the content-addressed store, hash-verified

24}
25
26func parseDOH3(c *caddy.Controller) error {
27 config := dnsserver.GetConfig(c)
28
29 // Skip the "https3" directive itself
30 c.Next()
31
32 // Get any arguments on the "https3" line
33 args := c.RemainingArgs()
34 if len(args) > 0 {
35 return c.ArgErr()
36 }
37
38 // Process all nested directives in the block
39 for c.NextBlock() {
40 switch c.Val() {
41 case "max_streams":
42 args := c.RemainingArgs()
43 if len(args) != 1 {
44 return c.ArgErr()
45 }
46 val, err := strconv.Atoi(args[0])
47 if err != nil {
48 return c.Errf("invalid max_streams value '%s': %v", args[0], err)
49 }
50 if val < 0 {
51 return c.Errf("max_streams must be a non-negative integer: %d", val)
52 }
53 if config.MaxHTTPS3Streams != nil {
54 return c.Err("max_streams already defined for this server block")
55 }
56 config.MaxHTTPS3Streams = &val
57 default:
58 return c.Errf("unknown property '%s'", c.Val())
59 }
60 }
61
62 return nil
63}

Callers 1

setupFunction · 0.85

Calls 2

GetConfigFunction · 0.92
NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…