SSL: removed conditions that always hold true.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5019 73f98a42-aea0-e011-b76d-00259023448c
SSL: resetting of flush flag after the data was written.

There is no need to flush next chunk of data if it does not contain a buffer
with the flush or last_buf flags set.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5020 73f98a42-aea0-e011-b76d-00259023448c
SSL: preservation of flush flag for buffered data.

Previously, if SSL buffer was not sent we lost information that the data
must be flushed.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5021 73f98a42-aea0-e011-b76d-00259023448c
SSL: calculation of buffer size moved closer to its usage.

No functional changes.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5022 73f98a42-aea0-e011-b76d-00259023448c
SSL: avoid calling SSL_write() with zero data size.

According to documentation, calling SSL_write() with num=0 bytes to be sent
results in undefined behavior.

We don't currently call ngx_ssl_send_chain() with empty chain and buffer.
This check handles the case of a chain with total data size that is
a multiple of NGX_SSL_BUFSIZE, and with the special buffer at the end.

In practice such cases resulted in premature connection close and critical
error "SSL_write() failed (SSL:)" in the error log.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5023 73f98a42-aea0-e011-b76d-00259023448c
SSL: take into account data in the buffer while limiting output.

In some rare cases this can result in a more smooth sending rate.



git-svn-id: svn://svn.nginx.org/nginx/trunk@5024 73f98a42-aea0-e011-b76d-00259023448c