http://rt.openssl.org/Ticket/Attachment/37748/20587/ --- openssl-1.0.1g/ssl/s3_pkt.c.orig 2014-04-11 08:10:03.115295077 -0300 +++ openssl-1.0.1g/ssl/s3_pkt.c 2014-04-11 08:10:38.788435152 -0300 @@ -1055,7 +1055,7 @@ { s->rstate=SSL_ST_READ_HEADER; rr->off=0; - if (s->mode & SSL_MODE_RELEASE_BUFFERS) + if (s->mode & SSL_MODE_RELEASE_BUFFERS && s->s3->rbuf.left == 0) ssl3_release_read_buffer(s); } }