summaryrefslogtreecommitdiff
path: root/ssl/s2_pkt.c
diff options
context:
space:
mode:
authorbodo <bodo>1999-07-02 13:55:30 +0000
committerbodo <bodo>1999-07-02 13:55:30 +0000
commita8553b23971b61483c0a3f8a4dedf0da4b2657aa (patch)
tree959f670f8166037a31d4ee36e0a845067a882d66 /ssl/s2_pkt.c
parentefac3d94af0b8ae5fc749752d524e5185bb8d92d (diff)
downloadopenssl-a8553b23971b61483c0a3f8a4dedf0da4b2657aa.tar.gz
New functions SSL[_CTX]_{set,get}_mode; the initial set of mode flags is
SSL_MODE_ENABLE_PARTIAL_WRITE, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER.
Diffstat (limited to 'ssl/s2_pkt.c')
-rw-r--r--ssl/s2_pkt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ssl/s2_pkt.c b/ssl/s2_pkt.c
index 73c96f3c3..39d8010bd 100644
--- a/ssl/s2_pkt.c
+++ b/ssl/s2_pkt.c
@@ -391,8 +391,12 @@ int ssl2_write(SSL *s, const void *_buf, int len)
s->s2->wnum=tot;
return(i);
}
- if (i == (int)n) return(tot+i);
-
+ if ((i == (int)n) ||
+ (s->mode | SSL_MODE_ENABLE_PARTIAL_WRITE))
+ {
+ return(tot+i);
+ }
+
n-=i;
tot+=i;
}
@@ -406,7 +410,9 @@ static int write_pending(SSL *s, const unsigned char *buf, unsigned int len)
/* check that they have given us the same buffer to
* write */
- if ((s->s2->wpend_tot > (int)len) || (s->s2->wpend_buf != buf))
+ if ((s->s2->wpend_tot > (int)len) ||
+ ((s->s2->wpend_buf != buf) &&
+ (!s->mode & SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER)))
{
SSLerr(SSL_F_WRITE_PENDING,SSL_R_BAD_WRITE_RETRY);
return(-1);