diff options
author | Bodo Möller <bodo@openssl.org> | 1999-07-02 13:55:32 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 1999-07-02 13:55:32 +0000 |
commit | e105643595707085588ee43a29d607a56ddb1ed1 (patch) | |
tree | 47cba7caac38e766bc6721adbf513e4d287ac553 /ssl/s3_pkt.c | |
parent | e0371fe4dc65ec62861e0ef293305442c0d97269 (diff) |
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/s3_pkt.c')
-rw-r--r-- | ssl/s3_pkt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 4a195095d9..c9dc7cc616 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -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); |