Fix error codes for memory-saving patch.

Also, get rid of compile-time switch OPENSSL_NO_RELEASE_BUFFERS
because it was rather pointless (the new behavior has to be explicitly
requested by setting SSL_MODE_RELEASE_BUFFERS anyway).
This commit is contained in:
Bodo Möller
2008-08-04 22:10:38 +00:00
parent 3e727a3b37
commit 474b3b1cc8
6 changed files with 17 additions and 21 deletions

View File

@@ -238,11 +238,9 @@ int ssl3_read_n(SSL *s, int n, int max, int extend)
if (i <= 0)
{
rb->left = left;
#ifndef OPENSSL_NO_RELEASE_BUFFERS
if (len+left == 0 &&
(s->mode & SSL_MODE_RELEASE_BUFFERS))
ssl3_release_read_buffer(s);
#endif
if (s->mode & SSL_MODE_RELEASE_BUFFERS)
if (len+left == 0)
ssl3_release_read_buffer(s);
return(i);
}
left+=i;
@@ -825,10 +823,8 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf,
{
wb->left=0;
wb->offset+=i;
#ifndef OPENSSL_NO_RELEASE_BUFFERS
if (s->mode & SSL_MODE_RELEASE_BUFFERS)
ssl3_release_write_buffer(s);
#endif
s->rwstate=SSL_NOTHING;
return(s->s3->wpend_ret);
}
@@ -983,10 +979,8 @@ start:
{
s->rstate=SSL_ST_READ_HEADER;
rr->off=0;
#ifndef OPENSSL_NO_RELEASE_BUFFERS
if ((s->mode & SSL_MODE_RELEASE_BUFFERS))
if (s->mode & SSL_MODE_RELEASE_BUFFERS)
ssl3_release_read_buffer(s);
#endif
}
}
return(n);