Keep the gateway connection alive and resume hosted queues after reconnecting
CI / build (push) Successful in 30s

The client doesn't ping while it's sending, so when the proxy answers its frames itself (everything it
sends in a hosted room), IMVU's gateway saw an idle connection and closed it after about a minute. A
ping now goes to the gateway in place of each answered frame. And after a reconnect, hosted rooms'
queues are taken out of C2gOpenFloodgates and answered here (the gateway never answered them, so the
client gave up and closed the room).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-30 05:37:53 -07:00
1 parent c483099558
commit 08a2ed94a3
4 files changed
+94 -12

No files matched your search

+14
View File
@@ -97,3 +97,17 @@ func TestSubscriptionOps(t *testing.T) {
t.Fatalf("all %v", all)
}
}
func TestFloodgates(t *testing.T) {
state := func(q string, seq, op uint64) []byte {
return appendVarintField(appendVarintField(appendBytesField(nil, 1, []byte(q)), 2, seq), 3, op)
}
data := appendBytesField(appendBytesField(nil, 1, state("/user/1", 38, 19)), 1, state("/chat/2100000001", 29, 20))
states, err := ParseFloodgates(data)
if err != nil || len(states) != 2 || states[1].Queue != "/chat/2100000001" || states[1].OpID != 20 {
t.Fatalf("%+v %v", states, err)
}
if string(MarshalFloodgates(states)) != string(data) || string(MarshalFloodgates(states[:1])) != string(appendBytesField(nil, 1, state("/user/1", 38, 19))) {
t.Fatal("re-encoded differently")
}
}