If application has more data than maximum fragment, hold to buffer
for whole write, as opposite to per-fragment strategy.
i=do_ssl3_write(s, type, &(buf[tot]), nw, 0);
if (i <= 0)
{
+ /* XXX should we ssl3_release_write_buffer if i<0? */
s->s3->wnum=tot;
return i;
}
/* next chunk of data should get another prepended empty fragment
* in ciphersuites with known-IV weakness: */
s->s3->empty_fragment_done = 0;
-
+
+ if ((i==(int)n) && s->mode & SSL_MODE_RELEASE_BUFFERS &&
+ !SSL_IS_DTLS(s))
+ ssl3_release_write_buffer(s);
+
return tot+i;
}
{
wb->left=0;
wb->offset+=i;
- if (s->mode & SSL_MODE_RELEASE_BUFFERS &&
- !SSL_IS_DTLS(s))
- ssl3_release_write_buffer(s);
s->rwstate=SSL_NOTHING;
return(s->s3->wpend_ret);
}