aboutsummaryrefslogtreecommitdiff
path: root/src/os/win32/ngx_win32_init.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2019-10-17 16:02:24 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2019-10-17 16:02:24 +0300
commit798fcf1ab4b77441a4cdf368a6cb11dc1c0c39c8 (patch)
treed88fbd64da602e9d8e5ab6e35c8877c34f9253ba /src/os/win32/ngx_win32_init.c
parentfac4c7bdf53ee7d8fec6568f1e9fecefcde6feba (diff)
downloadnginx-798fcf1ab4b77441a4cdf368a6cb11dc1c0c39c8.tar.gz
nginx-798fcf1ab4b77441a4cdf368a6cb11dc1c0c39c8.zip
SSL: available bytes handling (ticket #1431).
Added code to track number of bytes available in the socket. This makes it possible to avoid looping for a long time while working with fast enough peer when data are added to the socket buffer faster than we are able to read and process data. When kernel does not provide number of bytes available, it is retrieved using ioctl(FIONREAD) as long as a buffer is filled by SSL_read(). It is assumed that number of bytes returned by SSL_read() is close to the number of bytes read from the socket, as we do not use SSL compression. But even if it is not true for some reason, this is not important, as we post an additional reading event anyway. Note that data can be buffered at SSL layer, and it is not possible to simply stop reading at some point and wait till the event will be reported by the kernel again. This can be only done when there are no data in SSL buffers, and there is no good way to find out if it's the case. Instead of trying to figure out if SSL buffers are empty, this patch introduces events posted for the next event loop iteration - such events will be processed only on the next event loop iteration, after going into the kernel and retrieving additional events. This seems to be simple and reliable approach.
Diffstat (limited to 'src/os/win32/ngx_win32_init.c')
0 files changed, 0 insertions, 0 deletions