MCPcopy
hub / github.com/jackc/pgx / SetMaxBodyLen

Method SetMaxBodyLen

pgproto3/backend.go:297–299  ·  view source on GitHub ↗

SetMaxBodyLen sets the maximum length of a message body in octets. If a message body exceeds this length, Receive will return an error. This is useful for protecting against malicious clients that send large messages with the intent of causing memory exhaustion. The default value is 0. If maxBodyLen

(maxBodyLen int)

Source from the content-addressed store, hash-verified

295// The default value is 0.
296// If maxBodyLen is 0, then no maximum is enforced.
297func (b *Backend) SetMaxBodyLen(maxBodyLen int) {
298 b.maxBodyLen = maxBodyLen
299}

Callers 1

Calls

no outgoing calls

Tested by 1