Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xpc file to properly work with Garble #548

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ios/dtx_codec/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (g GlobalDispatcher) Dispatch(msg Message) {
if msg.HasError() {
log.Error(msg.Payload[0])
}
if msg.PayloadHeader.MessageType == UnknownTypeOne {
if msg.PayloadHeader.MessageType == UnknownTypeOne || msg.PayloadHeader.MessageType == ResponseWithReturnValueInPayload {
g.dtxConnection.Dispatch(msg)
}
}
Expand Down
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