Author: toad
Date: 2006-10-05 21:03:01 +0000 (Thu, 05 Oct 2006)
New Revision: 10620

Modified:
   trunk/freenet/src/freenet/node/fcp/FCPClient.java
Log:
Better toString().
Frost hack: hello-[0-9]* indicates frost. Treat as a single client for request 
selection (see later commits for use, here we just define the variable).

Modified: trunk/freenet/src/freenet/node/fcp/FCPClient.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPClient.java   2006-10-05 21:00:35 UTC 
(rev 10619)
+++ trunk/freenet/src/freenet/node/fcp/FCPClient.java   2006-10-05 21:03:01 UTC 
(rev 10620)
@@ -19,6 +19,9 @@
  */
 public class FCPClient {

+       // FIXME frost-specific hack
+       private static final Object frostClient = new Object();
+       
        /** Maximum number of unacknowledged completed requests */
        private static final int MAX_UNACKED_REQUESTS = 256;

@@ -37,6 +40,12 @@
                clientsWatching = new LinkedList();
                watchGlobalVerbosityMask = Integer.MAX_VALUE;
                toStart = new LinkedList();
+               // FIXME frost-specific hack
+               if(name.matches("hello-[0-9]*")) {
+                       // Greedy frost
+                       lowLevelClient = frostClient;
+               } else
+                       lowLevelClient = this;
        }

        /** The client's Name sent in the ClientHello message */
@@ -66,6 +75,8 @@
        // We obviously can't synchronize on it when it hasn't been constructed 
yet...
        final LinkedList clientsWatching;
        private final LinkedList toStart;
+       /** Low-level client object, for freenet.client.async. Normally == 
this. */
+       final Object lowLevelClient;

        public synchronized FCPConnectionHandler getConnection() {
                return currentConnection;
@@ -257,4 +268,7 @@
                        reqs[i].start();
        }

+       public String toString() {
+               return super.toString()+":"+name;
+       }
 }


Reply via email to