Skip to content

Commit

Permalink
Fix encoding.go to properly work with Garble
Browse files Browse the repository at this point in the history
  • Loading branch information
cziter15 authored Jan 16, 2025
1 parent e0141a0 commit 84074c6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ios/xpc/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ type Message struct {
Id uint64
}

type MagicAndVersion struct {
magic uint32
version uint32
}

func (m Message) IsFileOpen() bool {
return m.Flags&FileOpenFlag > 0
}
Expand Down Expand Up @@ -114,21 +119,15 @@ func EncodeMessage(w io.Writer, message Message) error {
wrapper := struct {
magic uint32
h wrapperHeader
body struct {
magic uint32
version uint32
}
body MagicAndVersion
}{
magic: wrapperMagic,
h: wrapperHeader{
Flags: message.Flags,
BodyLen: uint64(buf.Len() + 8),
MsgId: message.Id,
},
body: struct {
magic uint32
version uint32
}{
body: MagicAndVersion{
magic: objectMagic,
version: bodyVersion,
},
Expand Down

0 comments on commit 84074c6

Please sign in to comment.