From 99480fcbcb68be6a357f6218668feab697e1a93d Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Tue, 07 Jul 2009 14:55:26 +0000
Subject: [PATCH] Fix for 4096 MonitorMsg is not compatible with replication version

---
 opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java |   34 +++++++++++++++++++++++++++-------
 1 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java b/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
index baa4737..3bae821 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationServerDomain.java
@@ -1509,8 +1509,21 @@
         // in the topology.
         if (senderHandler.isDataServer())
         {
-          MonitorMsg returnMsg =
+          MonitorMsg returnMsg;
+
+          if (senderHandler.getProtocolVersion() >
+                             ProtocolVersion.REPLICATION_PROTOCOL_V1)
+          {
+           returnMsg =
             new MonitorMsg(msg.getDestination(), msg.getsenderID());
+          }
+          else
+          {
+            returnMsg =
+              new MonitorMsg(msg.getDestination(), msg.getsenderID(),
+                  ProtocolVersion.REPLICATION_PROTOCOL_V1);
+          }
+
           try
           {
             returnMsg.setReplServerDbState(getDbServerState());
@@ -1555,13 +1568,20 @@
           return;
         }
 
-        MonitorRequestMsg replServerMonitorRequestMsg =
-          (MonitorRequestMsg) msg;
+        MonitorMsg monitorMsg;
 
-        MonitorMsg monitorMsg =
-          new MonitorMsg(
-          replServerMonitorRequestMsg.getDestination(),
-          replServerMonitorRequestMsg.getsenderID());
+        if (senderHandler.getProtocolVersion() >
+                                  ProtocolVersion.REPLICATION_PROTOCOL_V1)
+        {
+          monitorMsg =
+            new MonitorMsg(msg.getDestination(), msg.getsenderID());
+        }
+        else
+        {
+          monitorMsg =
+            new MonitorMsg(msg.getDestination(), msg.getsenderID(),
+                ProtocolVersion.REPLICATION_PROTOCOL_V1);
+        }
 
         // Populate for each connected LDAP Server
         // from the states stored in the serverHandler.

--
Gitblit v1.10.0