Commit 47e3cdd9 authored by Kirill Smelkov's avatar Kirill Smelkov

go/neo/neonet: msgPack -> pktEncode

Just renaming.
parent 41a120c1
...@@ -1305,8 +1305,8 @@ func (c *Conn) err(op string, e error) error { ...@@ -1305,8 +1305,8 @@ func (c *Conn) err(op string, e error) error {
// ---- exchange of messages ---- // ---- exchange of messages ----
// msgPack allocates pktBuf and encodes msg into it. // pktEncode allocates pktBuf and encodes msg into it.
func msgPack(connId uint32, msg proto.Msg) *pktBuf { func pktEncode(connId uint32, msg proto.Msg) *pktBuf {
l := msg.NEOMsgEncodedLen() l := msg.NEOMsgEncodedLen()
buf := pktAlloc(proto.PktHeaderLen + l) buf := pktAlloc(proto.PktHeaderLen + l)
...@@ -1358,14 +1358,14 @@ func (c *Conn) Recv() (proto.Msg, error) { ...@@ -1358,14 +1358,14 @@ func (c *Conn) Recv() (proto.Msg, error) {
// //
// it is ok to call sendMsg in parallel with serveSend. XXX link to sendPktDirect for rationale? // it is ok to call sendMsg in parallel with serveSend. XXX link to sendPktDirect for rationale?
func (link *NodeLink) sendMsg(connId uint32, msg proto.Msg) error { func (link *NodeLink) sendMsg(connId uint32, msg proto.Msg) error {
buf := msgPack(connId, msg) buf := pktEncode(connId, msg)
return link.sendPkt(buf) // XXX more context in err? (msg type) return link.sendPkt(buf) // XXX more context in err? (msg type)
// FIXME ^^^ shutdown whole link on error // FIXME ^^^ shutdown whole link on error
} }
// Send sends message over the connection. // Send sends message over the connection.
func (c *Conn) Send(msg proto.Msg) error { func (c *Conn) Send(msg proto.Msg) error {
buf := msgPack(c.connId, msg) buf := pktEncode(c.connId, msg)
return c.sendPkt(buf) // XXX more context in err? (msg type) return c.sendPkt(buf) // XXX more context in err? (msg type)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment