From 4287153a2c0323d20e6619c4ea52fa8057ff946d Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Wed, 25 Jul 2007 17:31:32 +0000
Subject: [PATCH] Fix for issue #1015: ldapsearch --verbose option doesn't work. This change causes ldapsearch and ldapmodify verbose options to trace the contents of incoming and outgoing LDAP messages and ASN.1 elements to standard error stream. It excludes search-result-entry messages from the trace since this would be rather too verbose and not very useful. The main use for verbose output is to investigate connection problems, referral following and such. A possible improvement would be to use a separate option for the ASN.1 tracing, and add session related output such as connection details, security context details and auth details as well as referral chasing details (all this must currently be derived from the protocol trace).

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

diff --git a/opends/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java b/opends/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
index 303e36c..83b972a 100644
--- a/opends/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
+++ b/opends/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
@@ -96,12 +96,10 @@
     // Create and send the LDAP compare request to the server.
     ProtocolOp op = new CompareRequestProtocolOp(dnStr, attrName, attrValue);
     LDAPMessage msg = new LDAPMessage(DSMLServlet.nextMessageID(), op);
-    int numBytes = connection.getASN1Writer().writeElement(msg.encode());
+    connection.getLDAPWriter().writeMessage(msg);
 
     // Read and decode the LDAP response from the server.
-    ASN1Element element = connection.getASN1Reader().readElement();
-    LDAPMessage responseMessage =
-          LDAPMessage.decode(ASN1Sequence.decodeAsSequence(element));
+    LDAPMessage responseMessage = connection.getLDAPReader().readMessage();
 
     CompareResponseProtocolOp compareOp =
           responseMessage.getCompareResponseProtocolOp();

--
Gitblit v1.10.0