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/s2_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/s2_pkt.c')
-rw-r--r-- | ssl/s2_pkt.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ssl/s2_pkt.c b/ssl/s2_pkt.c index 73c96f3c36..39d8010bde 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); |