typo
[openssl.git] / ssl / s3_pkt.c
index 4a195095d919490d4c877a7f35f981d6f04d6d52..6613e112c24e38eb02ce792f2a54ae703b05f4ed 100644 (file)
@@ -468,7 +468,12 @@ int ssl3_write_bytes(SSL *s, int type, const void *_buf, int len)
                if (type == SSL3_RT_HANDSHAKE)
                        ssl3_finish_mac(s,&(buf[tot]),i);
 
-               if (i == (int)n) return(tot+i);
+               if ((i == (int)n) ||
+                       (type == SSL3_RT_APPLICATION_DATA &&
+                       (s->mode | SSL_MODE_ENABLE_PARTIAL_WRITE)))
+                       {
+                       return(tot+i);
+                       }
 
                n-=i;
                tot+=i;
@@ -596,7 +601,9 @@ static int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
        int i;
 
 /* XXXX */
-       if ((s->s3->wpend_tot > (int)len) || (s->s3->wpend_buf != buf)
+       if ((s->s3->wpend_tot > (int)len)
+               || ((s->s3->wpend_buf != buf) &&
+                       !(s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER))
                || (s->s3->wpend_type != type))
                {
                SSLerr(SSL_F_SSL3_WRITE_PENDING,SSL_R_BAD_WRITE_RETRY);