directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1300183 - /directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/log/UserLogRecord.java
Date Tue, 13 Mar 2012 15:23:45 GMT
Author: elecharny
Date: Tue Mar 13 15:23:45 2012
New Revision: 1300183

URL: http://svn.apache.org/viewvc?rev=1300183&view=rev
Log:
Fixed a potential error : the buffer length was written as a byte, not as a int

Modified:
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/log/UserLogRecord.java

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/log/UserLogRecord.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/log/UserLogRecord.java?rev=1300183&r1=1300182&r2=1300183&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/log/UserLogRecord.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/log/UserLogRecord.java
Tue Mar 13 15:23:45 2012
@@ -27,7 +27,18 @@ import java.io.ObjectOutput;
 
 
 /** 
- * A user log record that can be used to pass user record between the clients and the logger.
+ * A user log record that can be used to pass user record between the clients and the logger.

+ * It contains a byte array which may not be used completely, and a position in the Log file.<br/>
+ * <br/>
+ * Here, we can see a RecordHolder containing some data, where the data's length is smaller
+ * than the RecordHolder's length :
+ * <pre>
+ * +--------------------------+----------+
+ * |XXXXXXXXXXXXXXXXXXXXXXXXXX|          |
+ * +--------------------------+----------+
+ *  <---------data----------->
+ *  <-------------RecordHolder---------->
+ * </pre>
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -104,8 +115,9 @@ public class UserLogRecord implements Ex
     /**
      * Write the UserLogRecord in a stream. The format is : <br/>
      * <ul>
-     * <li>length of the stored data</li>
-     * <li>data</li>
+     * <li>length of the stored data into the buffer</li>
+     * <li>length of the buffer
+     * <li>the buffer containing the data</li>
      * <li>The logAnchor</li>
      * </ul>
      */
@@ -113,7 +125,7 @@ public class UserLogRecord implements Ex
     public void writeExternal( ObjectOutput out ) throws IOException
     {
         out.writeInt( length );
-        out.write( recordHolder.length );
+        out.writeInt( recordHolder.length );
         out.write( recordHolder );
         logAnchor.writeExternal( out );
     }



Mime
View raw message