)
func TestTx(t *testing.T) {
- f := func(hops uint8, pathSrc, data string, nice uint8, padSize int16) bool {
+ f := func(hops uint8, pathSrc, data string, nice, replyNice uint8, padSize int16) bool {
if len(pathSrc) > int(MaxPathSize) {
pathSrc = pathSrc[:MaxPathSize]
}
privates[*node.Id] = node
nodeTgt.Via = append(nodeTgt.Via, node.Id)
}
- pkt, err := NewPkt(PktTypeMail, 123, pathSrc)
+ pkt, err := NewPkt(PktTypeExec, replyNice, []byte(pathSrc))
src := strings.NewReader(data)
dstNode, err := ctx.Tx(
nodeTgt,
return false
}
if *hopId == *nodeTgt.Id {
- if pkt.Type != PktTypeMail {
+ if pkt.Type != PktTypeExec {
+ return false
+ }
+ if pkt.Nice != replyNice {
return false
}
if !bytes.HasPrefix(pkt.Path[:], []byte(pathSrc)) {