Author: toad
Date: 2007-04-13 20:44:03 +0000 (Fri, 13 Apr 2007)
New Revision: 12662

Modified:
   trunk/freenet/src/freenet/node/CHKInsertSender.java
   trunk/freenet/src/freenet/node/InsertHandler.java
   trunk/freenet/src/freenet/node/PeerNode.java
   trunk/freenet/src/freenet/node/RequestHandler.java
   trunk/freenet/src/freenet/node/RequestSender.java
   trunk/freenet/src/freenet/node/SSKInsertHandler.java
Log:
Rename send() to sendSync()

Modified: trunk/freenet/src/freenet/node/CHKInsertSender.java
===================================================================
--- trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-04-13 20:39:23 UTC 
(rev 12661)
+++ trunk/freenet/src/freenet/node/CHKInsertSender.java 2007-04-13 20:44:03 UTC 
(rev 12662)
@@ -288,7 +288,7 @@
             // Send to next node

             try {
-                               next.send(req, this);
+                               next.sendSync(req, this);
                        } catch (NotConnectedException e1) {
                                if(logMINOR) Logger.minor(this, "Not connected 
to "+next);
                                continue;
@@ -390,7 +390,7 @@
             if(logMINOR) Logger.minor(this, "Sending DataInsert");
             if(receiveFailed) return;
             try {
-                               next.send(dataInsert, this);
+                               next.sendSync(dataInsert, this);
                        } catch (NotConnectedException e1) {
                                if(logMINOR) Logger.minor(this, "Not connected 
sending DataInsert: "+next+" for "+uid);
                                continue;

Modified: trunk/freenet/src/freenet/node/InsertHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/InsertHandler.java   2007-04-13 20:39:23 UTC 
(rev 12661)
+++ trunk/freenet/src/freenet/node/InsertHandler.java   2007-04-13 20:44:03 UTC 
(rev 12662)
@@ -88,7 +88,7 @@
         // Send Accepted
         Message accepted = DMT.createFNPAccepted(uid);
         try {
-                       source.send(accepted, this);
+                       source.sendSync(accepted, this);
                } catch (NotConnectedException e1) {
                        if(logMINOR) Logger.minor(this, "Lost connection to 
source");
                        return;
@@ -153,7 +153,7 @@
             canCommit = true;
                msg = DMT.createFNPInsertReply(uid);
                try {
-                               source.send(msg, this);
+                               source.sendSync(msg, this);
                        } catch (NotConnectedException e) {
                                // Ignore
                        }
@@ -202,7 +202,7 @@
                // Forward it
                Message m = DMT.createFNPRejectedOverload(uid, false);
                try {
-                                       source.send(m, this);
+                                       source.sendSync(m, this);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -232,7 +232,7 @@
                        (status == CHKInsertSender.INTERNAL_ERROR)) {
                 msg = DMT.createFNPRejectedOverload(uid, true);
                 try {
-                                       source.send(msg, this);
+                                       source.sendSync(msg, this);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -248,7 +248,7 @@
             if((status == CHKInsertSender.ROUTE_NOT_FOUND) || (status == 
CHKInsertSender.ROUTE_REALLY_NOT_FOUND)) {
                 msg = DMT.createFNPRouteNotFound(uid, sender.getHTL());
                 try {
-                                       source.send(msg, this);
+                                       source.sendSync(msg, this);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -261,7 +261,7 @@
             if(status == CHKInsertSender.SUCCESS) {
                msg = DMT.createFNPInsertReply(uid);
                try {
-                                       source.send(msg, this);
+                                       source.sendSync(msg, this);
                                } catch (NotConnectedException e) {
                                        Logger.minor(this, "Lost connection to 
source");
                                        return;
@@ -275,7 +275,7 @@
             Logger.error(this, "Unknown status code: 
"+sender.getStatusString());
             msg = DMT.createFNPRejectedOverload(uid, true);
             try {
-                               source.send(msg, this);
+                               source.sendSync(msg, this);
                        } catch (NotConnectedException e) {
                                // Ignore
                        }
@@ -320,7 +320,7 @@
                boolean failed = sender.anyTransfersFailed();
                Message m = DMT.createFNPInsertTransfersCompleted(uid, failed);
                try {
-                       source.send(m, this);
+                       source.sendSync(m, this);
                        if(logMINOR) Logger.minor(this, "Sent completion: 
"+failed+" for "+this);
                } catch (NotConnectedException e1) {
                        if(logMINOR) Logger.minor(this, "Not connected: 
"+source+" for "+this);
@@ -396,7 +396,7 @@
                 runThread.interrupt();
                 Message msg = DMT.createFNPDataInsertRejected(uid, 
DMT.DATA_INSERT_REJECTED_RECEIVE_FAILED);
                 try {
-                    source.send(msg, InsertHandler.this);
+                    source.sendSync(msg, InsertHandler.this);
                 } catch (NotConnectedException ex) {
                     Logger.error(this, "Can't send "+msg+" to "+source+": 
"+ex);
                 }

Modified: trunk/freenet/src/freenet/node/PeerNode.java
===================================================================
--- trunk/freenet/src/freenet/node/PeerNode.java        2007-04-13 20:39:23 UTC 
(rev 12661)
+++ trunk/freenet/src/freenet/node/PeerNode.java        2007-04-13 20:44:03 UTC 
(rev 12662)
@@ -1247,7 +1247,7 @@
     /**
      * Send a message, right now, on this thread, to this node.
      */
-    public void send(Message req, ByteCounter ctr) throws 
NotConnectedException {
+    public void sendSync(Message req, ByteCounter ctr) throws 
NotConnectedException {
        synchronized(this) {
             if(!isConnected()) {
                 Logger.error(this, "Tried to send "+req+" but not connected to 
"+this, new Exception("debug"));

Modified: trunk/freenet/src/freenet/node/RequestHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestHandler.java  2007-04-13 20:39:23 UTC 
(rev 12661)
+++ trunk/freenet/src/freenet/node/RequestHandler.java  2007-04-13 20:44:03 UTC 
(rev 12662)
@@ -68,19 +68,19 @@
         htl = source.decrementHTL(htl);

         Message accepted = DMT.createFNPAccepted(uid);
-        source.send(accepted, null);
+        source.sendSync(accepted, null);

         Object o = node.makeRequestSender(key, htl, uid, source, closestLoc, 
resetClosestLoc, false, true, false);
         if(o instanceof KeyBlock) {
             KeyBlock block = (KeyBlock) o;
             Message df = createDataFound(block);
-            source.send(df, null);
+            source.sendSync(df, null);
             if(key instanceof NodeSSK) {
                 if(needsPubKey) {
                        DSAPublicKey key = 
((NodeSSK)block.getKey()).getPubKey();
                        Message pk = DMT.createFNPSSKPubKey(uid, key.asBytes());
                        if(logMINOR) Logger.minor(this, "Sending PK: "+key+ ' ' 
+key.toLongString());
-                       source.send(pk, null);
+                       source.sendSync(pk, null);
                 }
                 status = RequestSender.SUCCESS; // for byte logging
             }
@@ -99,7 +99,7 @@

         if(rs == null) { // ran out of htl?
             Message dnf = DMT.createFNPDataNotFound(uid);
-            source.send(dnf, null);
+            source.sendSync(dnf, null);
             status = RequestSender.DATA_NOT_FOUND; // for byte logging
             return;
         }
@@ -120,7 +120,7 @@
             if((waitStatus & RequestSender.WAIT_TRANSFERRING_DATA) != 0) {
                // Is a CHK.
                 Message df = DMT.createFNPCHKDataFound(uid, rs.getHeaders());
-                source.send(df, null);
+                source.sendSync(df, null);
                 PartiallyReceivedBlock prb = rs.getPRB();
                BlockTransmitter bt =
                    new BlockTransmitter(node.usm, source, uid, prb, 
node.outputThrottle, this);
@@ -139,7 +139,7 @@
                case RequestSender.NOT_FINISHED:
                case RequestSender.DATA_NOT_FOUND:
                     Message dnf = DMT.createFNPDataNotFound(uid);
-                       source.send(dnf, this);
+                       source.sendSync(dnf, this);
                        return;
                case RequestSender.GENERATED_REJECTED_OVERLOAD:
                case RequestSender.TIMED_OUT:
@@ -147,21 +147,21 @@
                        // Locally generated.
                    // Propagate back to source who needs to reduce send rate
                    Message reject = DMT.createFNPRejectedOverload(uid, true);
-                       source.send(reject, this);
+                       source.sendSync(reject, this);
                        return;
                case RequestSender.ROUTE_NOT_FOUND:
                    // Tell source
                    Message rnf = DMT.createFNPRouteNotFound(uid, rs.getHTL());
-                       source.send(rnf, this);
+                       source.sendSync(rnf, this);
                        return;
                case RequestSender.SUCCESS:
                        if(key instanceof NodeSSK) {
                         Message df = DMT.createFNPSSKDataFound(uid, 
rs.getHeaders(), rs.getSSKData());
-                        source.send(df, this);
+                        source.sendSync(df, this);
                         node.sentPayload(rs.getSSKData().length);
                         if(needsPubKey) {
                                Message pk = DMT.createFNPSSKPubKey(uid, 
((NodeSSK)rs.getSSKBlock().getKey()).getPubKey().asBytes());
-                               source.send(pk, this);
+                               source.sendSync(pk, this);
                         }
                        } else if(!rs.transferStarted()) {
                                Logger.error(this, "Status is SUCCESS but we 
never started a transfer on "+uid);
@@ -175,7 +175,7 @@
                                continue; // should have started transfer
                        }
                    reject = DMT.createFNPRejectedOverload(uid, true);
-                       source.send(reject, this);
+                       source.sendSync(reject, this);
                        return;
                case RequestSender.TRANSFER_FAILED:
                        if(key instanceof NodeCHK) {

Modified: trunk/freenet/src/freenet/node/RequestSender.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestSender.java   2007-04-13 20:39:23 UTC 
(rev 12661)
+++ trunk/freenet/src/freenet/node/RequestSender.java   2007-04-13 20:44:03 UTC 
(rev 12662)
@@ -153,7 +153,7 @@
             Message req = createDataRequest();


-            next.send(req, this);
+            next.sendSync(req, this);

             synchronized(this) {
                hasForwarded = true;

Modified: trunk/freenet/src/freenet/node/SSKInsertHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/SSKInsertHandler.java        2007-04-13 
20:39:23 UTC (rev 12661)
+++ trunk/freenet/src/freenet/node/SSKInsertHandler.java        2007-04-13 
20:44:03 UTC (rev 12662)
@@ -89,7 +89,7 @@
         Message accepted = DMT.createFNPSSKAccepted(uid, pubKey == null);

         try {
-                       source.send(accepted, this);
+                       source.sendSync(accepted, this);
                } catch (NotConnectedException e1) {
                        if(logMINOR) Logger.minor(this, "Lost connection to 
source");
                        return;
@@ -122,7 +122,7 @@
                                        Logger.error(this, "Invalid pubkey from 
"+source+" on "+uid);
                                        Message msg = 
DMT.createFNPDataInsertRejected(uid, DMT.DATA_INSERT_REJECTED_SSK_ERROR);
                                        try {
-                                               source.send(msg, this);
+                                               source.sendSync(msg, this);
                                        } catch (NotConnectedException ee) {
                                                // Ignore
                                        }
@@ -141,7 +141,7 @@
                        Logger.error(this, "Invalid SSK from "+source, e1);
                        Message msg = DMT.createFNPDataInsertRejected(uid, 
DMT.DATA_INSERT_REJECTED_SSK_ERROR);
                        try {
-                               source.send(msg, this);
+                               source.sendSync(msg, this);
                        } catch (NotConnectedException e) {
                                // Ignore
                        }
@@ -153,7 +153,7 @@
                if((storedBlock != null) && !storedBlock.equals(block)) {
                        Message msg = DMT.createFNPSSKDataFound(uid, 
storedBlock.getRawHeaders(), storedBlock.getRawData());
                        try {
-                               source.send(msg, this);
+                               source.sendSync(msg, this);
                                
node.sentPayload(storedBlock.getRawData().length);
                        } catch (NotConnectedException e) {
                                if(logMINOR) Logger.minor(this, "Lost 
connection to source on "+uid);
@@ -166,7 +166,7 @@
         if(htl == 0) {
                Message msg = DMT.createFNPInsertReply(uid);
                try {
-                               source.send(msg, this);
+                               source.sendSync(msg, this);
                        } catch (NotConnectedException e) {
                                // Ignore
                        }
@@ -195,7 +195,7 @@
                // Forward it
                Message m = DMT.createFNPRejectedOverload(uid, false);
                try {
-                                       source.send(m, this);
+                                       source.sendSync(m, this);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -214,7 +214,7 @@
                                }
                Message msg = DMT.createFNPSSKDataFound(uid, headers, data);
                try {
-                       source.send(msg, this);
+                       source.sendSync(msg, this);
                                node.sentPayload(data.length);
                } catch (NotConnectedException e) {
                        if(logMINOR) Logger.minor(this, "Lost connection to 
source");
@@ -236,7 +236,7 @@
                        (status == SSKInsertSender.INTERNAL_ERROR)) {
                 Message msg = DMT.createFNPRejectedOverload(uid, true);
                 try {
-                                       source.send(msg, this);
+                                       source.sendSync(msg, this);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -252,7 +252,7 @@
             if((status == SSKInsertSender.ROUTE_NOT_FOUND) || (status == 
SSKInsertSender.ROUTE_REALLY_NOT_FOUND)) {
                 Message msg = DMT.createFNPRouteNotFound(uid, sender.getHTL());
                 try {
-                                       source.send(msg, null);
+                                       source.sendSync(msg, null);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -265,7 +265,7 @@
             if(status == SSKInsertSender.SUCCESS) {
                Message msg = DMT.createFNPInsertReply(uid);
                try {
-                                       source.send(msg, null);
+                                       source.sendSync(msg, null);
                                } catch (NotConnectedException e) {
                                        if(logMINOR) Logger.minor(this, "Lost 
connection to source");
                                        return;
@@ -279,7 +279,7 @@
             Logger.error(this, "Unknown status code: 
"+sender.getStatusString());
             Message msg = DMT.createFNPRejectedOverload(uid, true);
             try {
-                               source.send(msg, null);
+                               source.sendSync(msg, null);
                        } catch (NotConnectedException e) {
                                // Ignore
                        }


Reply via email to