directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r507387 - in /directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder: MailExchangeRecordEncoder.java ResourceRecordEncoder.java ServerSelectionRecordEncoder.java StartOfAuthorityRecordEncoder.java
Date Wed, 14 Feb 2007 04:54:06 GMT
Author: erodriguez
Date: Tue Feb 13 20:54:05 2007
New Revision: 507387

URL: http://svn.apache.org/viewvc?view=rev&rev=507387
Log:
Applying patch attached to DIRSERVER-842 (Add tests for DNS codecs).
o  Bug fixes for size calculation in encoders.

Modified:
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
    directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java?view=diff&rev=507387&r1=507386&r2=507387
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/MailExchangeRecordEncoder.java
Tue Feb 13 20:54:05 2007
@@ -56,10 +56,7 @@
 {
     protected void putResourceRecordData( ByteBuffer byteBuffer, ResourceRecord record )
     {
-        int startPosition = prepareForSizedData( byteBuffer );
         byteBuffer.putShort( Short.parseShort( record.get( DnsAttribute.MX_PREFERENCE ) )
);
         putDomainName( byteBuffer, record.get( DnsAttribute.DOMAIN_NAME ) );
-
-        putDataSize( byteBuffer, startPosition );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java?view=diff&rev=507387&r1=507386&r2=507387
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ResourceRecordEncoder.java
Tue Feb 13 20:54:05 2007
@@ -73,7 +73,7 @@
         byte length = ( byte ) ( byteBuffer.position() - startPosition + 1 );
         byteBuffer.position( startPosition );
         byteBuffer.put( length );
-        byteBuffer.position( startPosition + 1 + length );
+        byteBuffer.position( startPosition + length - 1 );
     }
 
 

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java?view=diff&rev=507387&r1=507386&r2=507387
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/ServerSelectionRecordEncoder.java
Tue Feb 13 20:54:05 2007
@@ -132,12 +132,9 @@
 {
     protected void putResourceRecordData( ByteBuffer byteBuffer, ResourceRecord record )
     {
-        int startPosition = prepareForSizedData( byteBuffer );
         byteBuffer.putShort( Short.parseShort( record.get( DnsAttribute.SERVICE_PRIORITY
) ) );
         byteBuffer.putShort( Short.parseShort( record.get( DnsAttribute.SERVICE_WEIGHT )
) );
         byteBuffer.putShort( Short.parseShort( record.get( DnsAttribute.SERVICE_PORT ) )
);
         putDomainName( byteBuffer, record.get( DnsAttribute.DOMAIN_NAME ) );
-
-        putDataSize( byteBuffer, startPosition );
     }
 }

Modified: directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java?view=diff&rev=507387&r1=507386&r2=507387
==============================================================================
--- directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
(original)
+++ directory/apacheds/trunk/protocol-dns/src/main/java/org/apache/directory/server/dns/io/encoder/StartOfAuthorityRecordEncoder.java
Tue Feb 13 20:54:05 2007
@@ -107,8 +107,6 @@
         int expire = Integer.parseInt( record.get( DnsAttribute.SOA_EXPIRE ) );
         long minimum = Long.parseLong( record.get( DnsAttribute.SOA_MINIMUM ) );
 
-        int startPosition = prepareForSizedData( byteBuffer );
-
         putDomainName( byteBuffer, mName );
         putDomainName( byteBuffer, rName );
 
@@ -119,7 +117,5 @@
         byteBuffer.putInt( expire );
 
         byteBuffer.putInt( ( int ) minimum );
-
-        putDataSize( byteBuffer, startPosition );
     }
 }



Mime
View raw message