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

Method SetMaxBodyLen

pgproto3/frontend.go:473–475  ·  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 a corrupted server that sends messages with incorrect length, which can cause memory exhaustion. The default value is 0. If ma

(maxBodyLen int)

Source from the content-addressed store, hash-verified

471// The default value is 0.
472// If maxBodyLen is 0, then no maximum is enforced.
473func (f *Frontend) SetMaxBodyLen(maxBodyLen int) {
474 f.maxBodyLen = maxBodyLen
475}

Callers 1

Calls

no outgoing calls

Tested by 1