From a2f8e4f7d92b7fcbffd8e8f75b411e0423cda506 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 10 Dec 2010 21:20:47 +0000 Subject: [PATCH] This is what seems to be happening: the client requests a subscription on one connection, then disconnects. While that request is in the pipeline, it reconnects, then receives the subcription that the first connection requested before it sends its own subscription requests. To prevent this, make sure that the current connection is the same one that made the request. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6375 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/server/PresentsSession.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/threerings/presents/server/PresentsSession.java b/src/main/java/com/threerings/presents/server/PresentsSession.java index fe7b070a8..19d2b4237 100644 --- a/src/main/java/com/threerings/presents/server/PresentsSession.java +++ b/src/main/java/com/threerings/presents/server/PresentsSession.java @@ -958,6 +958,11 @@ public class PresentsSession { public DObject object; + public ClientProxy () + { + _oconn = getConnection(); + } + public void unsubscribe () { object.removeSubscriber(this); @@ -967,7 +972,8 @@ public class PresentsSession // from interface ProxySubscriber public void objectAvailable (DObject dobj) { - if (postMessage(new ObjectResponse(dobj))) { + // ensure that the connection is the same one that requested the subscription + if (getConnection() == _oconn && postMessage(new ObjectResponse(dobj))) { _firstEventId = _omgr.getNextEventId(false); object = dobj; ClientProxy orec; @@ -1021,6 +1027,7 @@ public class PresentsSession } protected long _firstEventId; + protected PresentsConnection _oconn; } /**