From 9bdf1f8ef1b97388b3e2bcf3c8a4412d8698af52 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 27 Aug 2010 23:02:23 +0000 Subject: [PATCH] Serialize the request early so that developers find out as soon as possible if they're fucking up. Also fixed up a comment. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6135 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/peer/server/PeerManager.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/presents/peer/server/PeerManager.java b/src/java/com/threerings/presents/peer/server/PeerManager.java index ef0d80277..9b32ca59c 100644 --- a/src/java/com/threerings/presents/peer/server/PeerManager.java +++ b/src/java/com/threerings/presents/peer/server/PeerManager.java @@ -485,7 +485,10 @@ public abstract class PeerManager return; } - // build a set of node names (including the local node) to + // serialize the action to make sure we can + byte[] requestBytes = flattenRequest(request); + + // build a set of node names (including the local node) to which to send the request final Set nodes = Sets.newHashSet(); if (request.isApplicable(_nodeobj)) { nodes.add(_nodeobj.nodeName); @@ -495,15 +498,11 @@ public abstract class PeerManager nodes.add(peer.getNodeName()); } } - if (nodes.isEmpty() && onDropped != null) { onDropped.run(); return; } - // serialize the action to make sure we can - byte[] requestBytes = flattenRequest(request); - for (final String node : nodes) { invokeNodeRequest(node, requestBytes, new InvocationService.ResultListener() { public void requestProcessed (Object result) {