Diff for /libraries/libldap/sasl.c between versions 1.64.2.7 and 1.75

version 1.64.2.7, 2009/10/31 00:11:22 version 1.75, 2009/10/26 18:19:20
Line 1 Line 1
 /* $OpenLDAP$ */  /* $OpenLDAP: pkg/ldap/libraries/libldap/sasl.c,v 1.74 2009/10/26 17:49:42 hyc Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 1998-2009 The OpenLDAP Foundation.   * Copyright 1998-2009 The OpenLDAP Foundation.
Line 698  sb_sasl_generic_write( Sockbuf_IO_Desc * Line 698  sb_sasl_generic_write( Sockbuf_IO_Desc *
                 }                  }
         }          }
   
         len2 = p->max_send - 100;       /* For safety margin */          /* If we're just retrying a partial write, ignore
         len2 = len > len2 ? len2 : len;           * the first byte of this request since we fudged it
            * below on the previous call.
         /* If we're just retrying a partial write, tell the  
          * caller it's done. Let them call again if there's  
          * still more left to write.  
          */           */
         if ( p->flags & LDAP_PVT_SASL_PARTIAL_WRITE ) {          if ( p->flags & LDAP_PVT_SASL_PARTIAL_WRITE ) {
                 p->flags ^= LDAP_PVT_SASL_PARTIAL_WRITE;                  p->flags ^= LDAP_PVT_SASL_PARTIAL_WRITE;
                 return len2;                  len--;
                   if ( !len )
                           return 1;
                   buf = (char *)buf + 1;
         }          }
   
         /* now encode the next packet. */          /* now encode the next packet. */
         p->ops->reset_buf( p, &p->buf_out );          p->ops->reset_buf( p, &p->buf_out );
   
           len2 = p->max_send - 100;       /* For safety margin */
           len2 = len > len2 ? len2 : len;
   
         ret = p->ops->encode( p, buf, len2, &p->buf_out );          ret = p->ops->encode( p, buf, len2, &p->buf_out );
   
         if ( ret != 0 ) {          if ( ret != 0 ) {
Line 726  sb_sasl_generic_write( Sockbuf_IO_Desc * Line 729  sb_sasl_generic_write( Sockbuf_IO_Desc *
   
         if ( ret < 0 ) {          if ( ret < 0 ) {
                 /* error? */                  /* error? */
                 int err = sock_errno();  
                 /* caller can retry this */  
                 if ( err == EAGAIN || err == EWOULDBLOCK || err == EINTR )  
                         p->flags |= LDAP_PVT_SASL_PARTIAL_WRITE;  
                 return ret;                  return ret;
         } else if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {          } else if ( p->buf_out.buf_ptr != p->buf_out.buf_end ) {
                 /* partial write? pretend nothing got written */                  /* partial write? */
                 len2 = 0;                  len2--;
                 p->flags |= LDAP_PVT_SASL_PARTIAL_WRITE;                  p->flags |= LDAP_PVT_SASL_PARTIAL_WRITE;
         }          }
   

Removed from v.1.64.2.7  
changed lines
  Added in v.1.75


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org