Update of /cvsroot/freenet/freenet/src/freenet/node/states/announcing
In directory sc8-pr-cvs1:/tmp/cvs-serv25857/src/freenet/node/states/announcing

Modified Files:
      Tag: stable
        AnnouncementRequestToken.java Announcing.java 
        ExecuteAnnouncement.java NewInitialRequest.java 
        SendAnnouncement.java 
Log Message:
5029: Merge from unstable after months of work. MASSIVE changes.
Highlights:
* Next Generation Routing, massive related changes
* Major changes to handling of messages and connections (PeerHandler and related 
changes)
* Even more non-blocking I/O
* Documentation improvements
* Lots of new diagnostics and config options
* Lots of bug fixes and performance tweaking
* Probably lots of new bugs too!


Index: AnnouncementRequestToken.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcing/AnnouncementRequestToken.java,v
retrieving revision 1.3.6.2
retrieving revision 1.3.6.3
diff -u -w -r1.3.6.2 -r1.3.6.3
--- AnnouncementRequestToken.java       15 Aug 2003 03:05:50 -0000      1.3.6.2
+++ AnnouncementRequestToken.java       28 Oct 2003 20:20:42 -0000      1.3.6.3
@@ -20,16 +20,17 @@
         this.attempts = attempts;
     }
     
-    public void restarted(Node n, long millis) {}
+    public void restarted(Node n, long millis, MessageSendCallback cb) {}
     
     public void insertReply(Node n, long millis) {}
     
-    public OutputStream dataFound(Node n, Storables sto, long ctLength) {
+    public TrailerWriter dataFound(Node n, Storables sto, long ctLength) {
         return null;
     }
     
     public void queryRejected(Node n, int htl, String reason, FieldSet fs,
-                              int unreachable, int restarted, int rejected) {
+                              int unreachable, int restarted, int rejected,
+                             MessageSendCallback cb) {
         ++failed;
         n.logger.log(this, "Failed "+failed+" of "+attempts
                            +" initial requests: "+reason, Logger.MINOR);

Index: Announcing.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/announcing/Announcing.java,v
retrieving revision 1.14.4.4.2.1
retrieving revision 1.14.4.4.2.2
diff -u -w -r1.14.4.4.2.1 -r1.14.4.4.2.2
--- Announcing.java     1 Jul 2003 02:27:16 -0000       1.14.4.4.2.1
+++ Announcing.java     28 Oct 2003 20:20:42 -0000      1.14.4.4.2.2
@@ -18,7 +18,7 @@
 
     static long startTime = -1;
     /**
-     * Places the Announcing state in the nodes state table, where it will
+     * Places the Announcing state in the node's state table, where it will
      * live.
      * @param n               The node to announce.
      * @param hopsToLive      HopsToLive to use on each message
@@ -43,7 +43,7 @@
                         + delay + " Threads: " + Node.announcementThreads +
                         " Attempts: " + Node.announcementAttempts, 
                         Core.logger.MINOR);
-        n.schedule(0, new PlaceAnnouncing(n.randSource.nextLong(),
+        n.schedule(0, new PlaceAnnouncing(n.getRandSource().nextLong(),
                                           hopsToLive, targets, useRT, delay));
     }
     
@@ -223,8 +223,9 @@
 
                     if (m < now.length && useRT) {
                         byte[] b = new byte[8];
-                        Core.randSource.nextBytes(b);
-                        Routing routes = n.rt.route(new Key(b), true);
+                        Core.getRandSource().nextBytes(b);
+                        Routing routes = 
+                           n.rt.route(new Key(b), hopsToLive, 0, true, false);
                         while (m < now.length) {
                             NodeReference nr = routes.getNextRoute();
                             if (nr == null) {

Index: ExecuteAnnouncement.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcing/ExecuteAnnouncement.java,v
retrieving revision 1.4.4.2.2.1
retrieving revision 1.4.4.2.2.2
diff -u -w -r1.4.4.2.2.1 -r1.4.4.2.2.2
--- ExecuteAnnouncement.java    1 Jul 2003 02:27:16 -0000       1.4.4.2.2.1
+++ ExecuteAnnouncement.java    28 Oct 2003 20:20:42 -0000      1.4.4.2.2.2
@@ -120,7 +120,8 @@
         AnnouncementExecute ae = new AnnouncementExecute(id, kl, sign);
         OutputStream out;
         try {
-            out = n.sendMessage(ae, target);
+            out = new TrailerWriterOutputStream(n.sendMessage(ae, target,
+                                                             3*getTime(hopsToLive)));
         } catch (CommunicationException e) {
             n.logger.log(this, "Sending AnnouncementExecute failed",
                          e, Logger.MINOR);

Index: NewInitialRequest.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcing/NewInitialRequest.java,v
retrieving revision 1.3
retrieving revision 1.3.6.1
diff -u -w -r1.3 -r1.3.6.1
--- NewInitialRequest.java      3 Jul 2002 22:58:04 -0000       1.3
+++ NewInitialRequest.java      28 Oct 2003 20:20:42 -0000      1.3.6.1
@@ -9,7 +9,7 @@
 public class NewInitialRequest extends State {
 
     static void schedule(Node n, Key k, AnnouncementRequestToken ft) {
-        long id = n.randSource.nextLong();
+        long id = n.getRandSource().nextLong();
         n.logger.log(NewInitialRequest.class,
             "Scheduling post-announcement request on chain "
             +Fields.longToHex(id)+", for key "+k,
@@ -59,7 +59,8 @@
     }
 
     public void lost(Node n) {
-        ft.queryRejected(n, htl, "Node lost state", null, 0, 0, 0);
+        ft.queryRejected(n, htl, "Node lost state", null, 0, 0, 0,
+                        new RequestSendCallback("QueryRejected (lost 
NewAnnouncement)", n, this));
     }
 }
 

Index: SendAnnouncement.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/node/states/announcing/SendAnnouncement.java,v
retrieving revision 1.9.4.2.2.2
retrieving revision 1.9.4.2.2.3
diff -u -w -r1.9.4.2.2.2 -r1.9.4.2.2.3
--- SendAnnouncement.java       1 Jul 2003 02:27:16 -0000       1.9.4.2.2.2
+++ SendAnnouncement.java       28 Oct 2003 20:20:42 -0000      1.9.4.2.2.3
@@ -88,7 +88,7 @@
                                                 
         // Our random commit value
         myVal = new byte[20];
-        n.randSource.nextBytes(myVal);
+        n.getRandSource().nextBytes(myVal);
 
         byte[] commitVal;
         
@@ -99,7 +99,8 @@
         
         try {
             n.sendMessage(new NodeAnnouncement(id, hopsToLive, 0, n.myRef,
-                                               n.myRef, commitVal), target);
+                                               n.myRef, commitVal), target,
+                         getTime(2));
 
             
             // Count outbound requests.
@@ -109,6 +110,7 @@
             }
 
             // Keep track of outbound requests for rate limiting.
+           if(n.outboundRequestLimit != null)
             n.outboundRequestLimit.inc();
 
             NoReply nr = new NoReply(id);

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to