MCPcopy Create free account
hub / github.com/andeya/erpc / ReplyBodyCodec

Method ReplyBodyCodec

context.go:546–561  ·  view source on GitHub ↗

ReplyBodyCodec initializes and returns the reply message body codec id.

()

Source from the content-addressed store, hash-verified

544
545// ReplyBodyCodec initializes and returns the reply message body codec id.
546func (c *handlerCtx) ReplyBodyCodec() byte {
547 id := c.output.BodyCodec()
548 if id != codec.NilCodecID {
549 return id
550 }
551 id, ok := GetAcceptBodyCodec(c.input.Meta())
552 if ok {
553 if _, err := codec.Get(id); err == nil {
554 c.output.SetBodyCodec(id)
555 return id
556 }
557 }
558 id = c.input.BodyCodec()
559 c.output.SetBodyCodec(id)
560 return id
561}
562
563func (c *handlerCtx) setReplyBodyCodec(hasError bool) {
564 if hasError {

Callers 1

setReplyBodyCodecMethod · 0.95

Calls 5

GetFunction · 0.92
GetAcceptBodyCodecFunction · 0.85
BodyCodecMethod · 0.65
MetaMethod · 0.65
SetBodyCodecMethod · 0.65

Tested by

no test coverage detected