From a5c5efbf8ca56c059709953f7fedb647dadaed06 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Thu, 27 May 2010 15:28:09 +0000
Subject: [PATCH] Fix for issues #3395 and #3998. The changes improves the replica initialization protocol, especially flow control and handling connection outage.

---
 opends/src/server/org/opends/server/replication/protocol/TopologyMsg.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/TopologyMsg.java b/opends/src/server/org/opends/server/replication/protocol/TopologyMsg.java
index c2c777b..c26fd77 100644
--- a/opends/src/server/org/opends/server/replication/protocol/TopologyMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/TopologyMsg.java
@@ -175,7 +175,9 @@
             oStream.write(attr.getBytes("UTF-8"));
             oStream.write(0);
           }
+          oStream.write(dsInfo.getProtocolVersion());
         }
+
       }
 
       // Put number of following RS info entries
@@ -302,6 +304,7 @@
         }
 
         Set<String> attrs = new HashSet<String>();
+        short protocolVersion = -1;
         if (version>=ProtocolVersion.REPLICATION_PROTOCOL_V4)
         {
           byte nAttrs = in[pos++];
@@ -317,12 +320,15 @@
             pos += length + 1;
             nRead++;
           }
+          /* Read Protocol version */
+          protocolVersion = Short.valueOf(in[pos++]);
         }
 
         /* Now create DSInfo and store it in list */
 
         DSInfo dsInfo = new DSInfo(dsId, rsId, generationId, status,
-          assuredFlag, assuredMode, safeDataLevel, groupId, refUrls, attrs);
+          assuredFlag, assuredMode, safeDataLevel, groupId, refUrls, attrs,
+          protocolVersion);
         dsList.add(dsInfo);
 
         nDsInfo--;

--
Gitblit v1.10.0