This commit is contained in:
2026-06-15 01:20:30 +03:00
parent b32279deaf
commit 80309aab99
20 changed files with 149 additions and 40 deletions

View File

@@ -49,6 +49,7 @@ type PreparedData struct {
// )
func (s *WritePreparer) Prepare(input []any) PreparedData {
s.w.Reset()
s.w.Write([]byte{
0, 0, 0, 0, 0, 0, 0, 0, 0, // size (max 9 byte)
})
@@ -249,7 +250,7 @@ func (s *WritePreparer) Reset() {
}
func getIndexRecords(buf []byte, count int) (list []IndexRecord) {
fmt.Printf("ipage: % x\n", buf)
//fmt.Printf("ipage: % x\n", buf)
i := 0
for range count {
var rec IndexRecord
@@ -268,5 +269,11 @@ func finalizePacket(w *bytes.Buffer, checksum uint32) []byte {
// cut empty bytes at start
start := 9 - bin.CountVarSize(bodySize)
bin.PutVarSize(packet[start:], bodySize)
fmt.Printf("checksum: %d\n", checksum)
fmt.Printf("bodySize: %d\n", bodySize)
//fmt.Printf("start: %d\n", start)
fmt.Printf("body: % x\n", packet[9:len(packet)-4])
return packet[start:]
}