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

Collect all devmod messages without requiring a final empty message #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 6 additions & 2 deletions core/do/to2/listener-to2-68-DeviceServiceInfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ func (h *DoTo2) DeviceServiceInfo68(w http.ResponseWriter, r *http.Request) {
return
}

// Collect any device service info into the full list of SIMs sent over the
// session, regardless of whether IsMoreServiceInfo=true (aka including the
// final service infos sent by the device before the owner responds with
// service info).
session.DeviceSIMs = append(session.DeviceSIMs, deviceServiceInfo.ServiceInfo...)

ownerServiceInfo := fdoshared.OwnerServiceInfo69{}

if deviceServiceInfo.IsMoreServiceInfo {
// Device keeps sending more service info
ownerServiceInfo.IsDone = false
ownerServiceInfo.IsMoreServiceInfo = false

session.DeviceSIMs = append(session.DeviceSIMs, deviceServiceInfo.ServiceInfo...)
} else {
// Owner is now sending its service info
if session.OwnerSIMsSendCounter == 0 {
Expand Down