MCPcopy
hub / github.com/caddyserver/caddy / encodeSize

Function encodeSize

modules/caddyhttp/reverseproxy/fastcgi/writer.go:109–117  ·  view source on GitHub ↗
(b []byte, size uint32)

Source from the content-addressed store, hash-verified

107}
108
109func encodeSize(b []byte, size uint32) int {
110 if size > 127 {
111 size |= 1 << 31
112 binary.BigEndian.PutUint32(b, size)
113 return 4
114 }
115 b[0] = byte(size) //nolint:gosec // false positive; b is made 8 bytes long, then this function is always called with b being at least 4 or 1 byte long
116 return 1
117}
118
119// writeHeader populate header wire data in buf, it abuses buffer.Bytes() modification
120func (w *streamWriter) writeHeader() {

Callers 1

writePairsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected