MCPcopy
hub / github.com/nats-io/nats.go / cloneMsgArg

Method cloneMsgArg

parser.go:422–430  ·  view source on GitHub ↗

cloneMsgArg is used when the split buffer scenario has the pubArg in the existing read buffer, but we need to hold onto it into the next read.

()

Source from the content-addressed store, hash-verified

420// cloneMsgArg is used when the split buffer scenario has the pubArg in the existing read buffer, but
421// we need to hold onto it into the next read.
422func (nc *Conn) cloneMsgArg() {
423 nc.ps.argBuf = nc.ps.scratch[:0]
424 nc.ps.argBuf = append(nc.ps.argBuf, nc.ps.ma.subject...)
425 nc.ps.argBuf = append(nc.ps.argBuf, nc.ps.ma.reply...)
426 nc.ps.ma.subject = nc.ps.argBuf[:len(nc.ps.ma.subject)]
427 if nc.ps.ma.reply != nil {
428 nc.ps.ma.reply = nc.ps.argBuf[len(nc.ps.ma.subject):]
429 }
430}
431
432const argsLenMax = 4
433

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected