1
0
forked from rosa/hakurei

cmd/mbf: optionally ignore reply

An acknowledgement is not always required in this use case. This change also adds 64 bits of connection configuration for future expansion.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-17 16:46:49 +09:00
parent a394971dd7
commit 9036986156
3 changed files with 57 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"bytes"
"context"
"encoding/binary"
"errors"
"io"
"log"
@@ -17,7 +18,7 @@ import (
"hakurei.app/message"
)
func TestCureFromIR(t *testing.T) {
func TestNoReply(t *testing.T) {
t.Parallel()
if !daemonDeadline().IsZero() {
t.Fatal("daemonDeadline did not return the zero value")
@@ -45,7 +46,11 @@ func TestCureFromIR(t *testing.T) {
}
}()
if _err := c.EncodeAll(
if _, _err := client.Write(
binary.LittleEndian.AppendUint64(nil, remoteNoReply),
); _err != nil {
panic(_err)
} else if _err = c.EncodeAll(
client,
pkg.NewFile("check", []byte{0}),
); _err != nil {
@@ -105,7 +110,7 @@ func TestDaemon(t *testing.T) {
}()
var p *check.Absolute
p, err = cureRemote(ctx, &addr, pkg.NewFile("check", []byte{0}))
p, err = cureRemote(ctx, &addr, pkg.NewFile("check", []byte{0}), 0)
if err != nil {
t.Fatalf("cureRemote: error = %v", err)
}