Commit 57a86cd5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 547a6fa9
......@@ -122,7 +122,7 @@ const (
LinkClient // link created as client
// for testing:
linkNoRecvSend LinkRole = 1<<16 // do not spawn serveRecv & serveSend
linkNoRecvSend LinkRole = 1 << 16 // do not spawn serveRecv & serveSend
linkFlagsMask LinkRole = (1<<32 - 1) << 16
)
......@@ -148,7 +148,7 @@ const (
func newNodeLink(conn net.Conn, role LinkRole) *NodeLink {
var nextConnId uint32
var acceptq chan *Conn
switch role&^linkFlagsMask {
switch role &^ linkFlagsMask {
case LinkServer:
nextConnId = 0 // all initiated by us connId will be even
acceptq = make(chan *Conn) // accept queue; TODO use backlog
......@@ -776,7 +776,7 @@ func (c *Conn) Send(msg Msg) error {
traceConnSendPre(c, msg)
l := msg.NEOMsgEncodedLen()
buf := PktBuf{make([]byte, PktHeadLen + l)} // TODO -> freelist
buf := PktBuf{make([]byte, PktHeadLen+l)} // TODO -> freelist
h := buf.Header()
// h.ConnId will be set by conn.Send
......
//go:generate stringer -output proto-str2.go -type ErrorCode,NodeType proto.go
//go:generate stringer -output zproto-str.go -type ErrorCode,NodeType proto.go
package neo
......
//go:generate sh -c "go run protogen.go >proto-marshal.go"
//go:generate sh -c "go run protogen.go >zproto-marshal.go"
package neo
// protocol definition
......
......@@ -180,6 +180,8 @@ func main() {
buf.emit(`// Code generated by protogen.go; DO NOT EDIT.
package neo
// protocol messages to/from wire marshalling.
import (
"encoding/binary"
"reflect"
......
......@@ -2,6 +2,8 @@
package neo
// protocol messages to/from wire marshalling.
import (
"encoding/binary"
"reflect"
......
// Code generated by "stringer -output proto-str2.go -type ErrorCode,NodeType proto.go"; DO NOT EDIT.
// Code generated by "stringer -output zproto-str.go -type ErrorCode,NodeType proto.go"; DO NOT EDIT.
package neo
......
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