From c015616756e6faa64060971753bc77978ae82dec Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Wed, 07 Oct 2009 12:19:42 +0000
Subject: [PATCH] The documentation and the configuration of a Replication Domain allow a maximum value of 65535 for the server-id property. Nevertheless, the server-id in the ReplicationDomain implementation is managed as a short allowing a maximum value of 32767.

---
 opends/src/server/org/opends/server/replication/protocol/UpdateMsg.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/UpdateMsg.java b/opends/src/server/org/opends/server/replication/protocol/UpdateMsg.java
index 5152c9a..8b7b081 100644
--- a/opends/src/server/org/opends/server/replication/protocol/UpdateMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/UpdateMsg.java
@@ -264,13 +264,14 @@
    * @param type the type of UpdateMsg to encode.
    * @param additionalLength additional length needed to encode the remaining
    *                         part of the UpdateMsg.
+   * @param version The ProtocolVersion to use when encoding.
    * @return a byte array containing the common header and enough space to
    *         encode the remaining bytes of the UpdateMsg as was specified
    *         by the additionalLength.
    *         (byte array length = common header length + additionalLength)
    * @throws UnsupportedEncodingException if UTF-8 is not supported.
    */
-  protected byte[] encodeHeader(byte type, int additionalLength)
+  protected byte[] encodeHeader(byte type, int additionalLength, short version)
     throws UnsupportedEncodingException
   {
     byte[] changeNumberByte =
@@ -371,7 +372,8 @@
   {
     /* Encode the header in a byte[] large enough to also contain the payload */
     byte [] resultByteArray =
-      encodeHeader(MSG_TYPE_GENERIC_UPDATE, payload.length);
+      encodeHeader(MSG_TYPE_GENERIC_UPDATE, payload.length,
+                   ProtocolVersion.getCurrentVersion());
 
     int pos = resultByteArray.length - payload.length;
 

--
Gitblit v1.10.0