MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / readMethods

Function readMethods

socks/auth_handler.go:67–77  ·  view source on GitHub ↗

readMethods is used to read the number and type of methods

(r io.Reader)

Source from the content-addressed store, hash-verified

65
66// readMethods is used to read the number and type of methods
67func readMethods(r io.Reader) ([]byte, error) {
68 header := []byte{0}
69 if _, err := r.Read(header); err != nil {
70 return nil, err
71 }
72
73 numMethods := int(header[0])
74 methods := make([]byte, numMethods)
75 _, err := io.ReadAtLeast(r, methods, numMethods)
76 return methods, err
77}

Callers 1

HandleMethod · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected