From fc649ad091ca53cbb9798ab193f0e36695abe825 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 09 May 2007 20:41:56 +0000
Subject: [PATCH] Update the DSML gateway so that it properly treats the request ID as an optional element rather than required.  Also, update the DSML search processing code to be a little more forgiving when it comes to the search scope and deref policy strings.

---
 opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java b/opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
index a7a41b6..6c5b996 100644
--- a/opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
+++ b/opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
@@ -85,19 +85,7 @@
     throws IOException, LDAPException, ASN1Exception
   {
     LDAPResult addResponse = objFactory.createLDAPResult();
-
-    String requestID = addRequest.getRequestID();
-    int reqID = 1;
-    try
-    {
-      reqID = Integer.parseInt(requestID);
-    } catch (NumberFormatException nfe)
-    {
-      throw new IOException(nfe.getMessage());
-    }
-
-    // Set the response id.
-    addResponse.setRequestID(requestID);
+    addResponse.setRequestID(addRequest.getRequestID());
 
     ASN1OctetString dnStr = new ASN1OctetString(addRequest.getDn());
     ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>();
@@ -117,7 +105,7 @@
 
     // Create and send the LDAP request to the server.
     ProtocolOp op = new AddRequestProtocolOp(dnStr, attributes);
-    LDAPMessage msg = new LDAPMessage(reqID, op);
+    LDAPMessage msg = new LDAPMessage(DSMLServlet.nextMessageID(), op);
     int numBytes = connection.getASN1Writer().writeElement(msg.encode());
 
     // Read and decode the LDAP response from the server.

--
Gitblit v1.10.0