directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r654363 - /directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixEncoder.java
Date Thu, 08 May 2008 01:03:25 GMT
Author: akarasulu
Date: Wed May  7 18:03:24 2008
New Revision: 654363

URL: http://svn.apache.org/viewvc?rev=654363&view=rev
Log:
fixing couple bugs in encoder to implement ldap client:

 o the blockingEncode method did not attach the output stream to the channel
   and caused NPE to be thrown
 o the buffer on decode callbacks was not being flipped before writing it to 
   the channel causing messages to be lost


Modified:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixEncoder.java

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixEncoder.java?rev=654363&r1=654362&r2=654363&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixEncoder.java
(original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixEncoder.java
Wed May  7 18:03:24 2008
@@ -68,7 +68,7 @@
      * 
      * @param provider The associated Provider
      */
-    public TwixEncoder(Provider provider)
+    public TwixEncoder( Provider provider )
     {
         this.provider = provider;
         encodeCallback = new OutputCallback();
@@ -92,6 +92,7 @@
                 log.debug( "Encoding this LdapMessage : " + obj );
             }
 
+            ( ( OutputCallback ) encodeCallback ).attach( out );
             encodeCallback.encodeOccurred( null, ( ( LdapMessage ) obj ).encode( null ) );
         }
         catch ( EncoderException e )
@@ -255,6 +256,7 @@
         {
             try
             {
+                ( ( ByteBuffer ) encoded ).flip();
                 channel.write( ( ByteBuffer ) encoded );
             }
             catch ( IOException e )



Mime
View raw message