[Fedora-directory-commits] ldapserver/ldap/servers/slapd sasl_io.c, 1.10, 1.11

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Wed Apr 25 20:24:38 UTC 2007


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12921

Modified Files:
	sasl_io.c 
Log Message:
Resolves: #237731
Summary: Random SASL GSSAPI test failure on shadowfoot
Description: As mentioned in the comment just above of the code: "we now must
read more data off the wire until we have the complete packet", we read more.



Index: sasl_io.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/sasl_io.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- sasl_io.c	10 Nov 2006 23:45:40 -0000	1.10
+++ sasl_io.c	25 Apr 2007 20:24:31 -0000	1.11
@@ -269,13 +269,15 @@
         }
         /* We now have the packet length
          * we now must read more data off the wire until we have the complete packet
-        */
-        ret = sasl_io_read_packet(c,err);
-        if (0 == ret || -1 == ret) {
-            return ret;
-        }
-        /* Are we there yet ? */
-        if (sasl_io_finished_packet(sp)) {
+         */
+        do {
+            ret = sasl_io_read_packet(c,err);
+            if (0 == ret || -1 == ret) {
+                return ret;
+            }
+        } while (!sasl_io_finished_packet(sp));
+        /* We are there. */
+        {
             const char *output_buffer = NULL;
             unsigned int output_length = 0;
             LDAPDebug( LDAP_DEBUG_CONNS,
@@ -298,14 +300,14 @@
                 "sasl_recv_connection failed to decode packet for connection %d\n", c->c_connid, 0, 0 );
             }
         }
-    }        
+    }
     /* Finally, return data from the buffer to the caller */
     {
         size_t bytes_to_return = sp->decrypted_buffer_count - sp->decrypted_buffer_offset;
         if (bytes_to_return > count) {
             bytes_to_return = count;
         }
-	/* Copy data from the decrypted buffer starting at the offset */
+        /* Copy data from the decrypted buffer starting at the offset */
         memcpy(buffer, sp->decrypted_buffer + sp->decrypted_buffer_offset, bytes_to_return);
         if (bytes_in_buffer == bytes_to_return) {
             sp->decrypted_buffer_offset = 0;




More information about the Fedora-directory-commits mailing list