summaryrefslogtreecommitdiffhomepage
path: root/src/event/ngx_event_posted.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-12-27SSL: reworked posted next events again.Maxim Dounin1-1/+1
Previous change 1ce3f01a4355 incorrectly introduced processing of the ngx_posted_next_events queue at the end of operation, effectively making posted next events a nop, since at the end of an event loop iteration the queue is always empty. Correct approach is to move events to the ngx_posted_events queue at an iteration start, as it was done previously. Further, in some cases the c->read event might be already in the ngx_posted_events queue, and calling ngx_post_event() with the ngx_posted_next_events queue won't do anything. To make sure the event will be correctly placed into the ngx_posted_next_events queue we now check if it is already posted.
2019-12-24SSL: reworked posted next events.Maxim Dounin1-0/+1
Introduced in 9d2ad2fb4423 available bytes handling in SSL relied on connection read handler being overwritten to set the ready flag and the amount of available bytes. This approach is, however, does not work properly when connection read handler is changed, for example, when switching to a next pipelined request, and can result in unexpected connection timeouts, see here: http://mailman.nginx.org/pipermail/nginx-devel/2019-December/012825.html Fix is to introduce ngx_event_process_posted_next() instead, which will set ready and available regardless of how event handler is set.
2019-10-17SSL: available bytes handling (ticket #1431).Maxim Dounin1-0/+1
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.
2015-03-27Events: made posted events macros safe.Valentin Bartenev1-8/+8
2014-09-01Events: processing of posted events changed from LIFO to FIFO.Valentin Bartenev1-18/+9
In theory, this can provide a bit better distribution of latencies. Also it simplifies the code, since ngx_queue_t is now used instead of custom implementation.
2014-09-01Events: removed broken thread support from posted events.Valentin Bartenev1-24/+6
It's mostly dead code. And the idea of thread support for this task has been deprecated.
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2005-10-19nginx-0.3.3-RELEASE importrelease-0.3.3Igor Sysoev1-24/+43
*) Change: the "bl" and "af" parameters of the "listen" directive was renamed to the "backlog" and "accept_filter". *) Feature: the "rcvbuf" and "sndbuf" parameters of the "listen" directive. *) Change: the "$msec" log parameter does not require now the additional the gettimeofday() system call. *) Feature: the -t switch now tests the "listen" directives. *) Bugfix: if the invalid address was specified in the "listen" directive, then after the -HUP signal nginx left an open socket in the CLOSED state. *) Bugfix: the mime type may be incorrectly set to default value for index file with variable in the name; the bug had appeared in 0.3.0. *) Feature: the "timer_resolution" directive. *) Feature: the millisecond "$upstream_response_time" log parameter. *) Bugfix: a temporary file with client request body now is removed just after the response header was transferred to a client. *) Bugfix: OpenSSL 0.9.6 compatibility. *) Bugfix: the SSL certificate and key file paths could not be relative. *) Bugfix: the "ssl_prefer_server_ciphers" directive did not work in the ngx_imap_ssl_module. *) Bugfix: the "ssl_protocols" directive allowed to specify the single protocol only.
2004-11-11nginx-0.1.5-RELEASE importrelease-0.1.5Igor Sysoev1-3/+3
*) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
2004-09-29nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyrightIgor Sysoev1-1/+1
2004-09-28nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused filesIgor Sysoev1-0/+6
2004-07-05nginx-0.0.7-2004-07-05-19:08:23 importIgor Sysoev1-2/+10
2004-07-05nginx-0.0.7-2004-07-05-10:55:54 importIgor Sysoev1-1/+1
2004-07-02nginx-0.0.7-2004-07-02-19:54:34 importIgor Sysoev1-21/+13
2004-07-02nginx-0.0.7-2004-07-02-09:47:00 importIgor Sysoev1-17/+1
2004-06-30nginx-0.0.7-2004-06-30-19:30:41 importIgor Sysoev1-0/+34
2004-06-28nginx-0.0.7-2004-06-29-01:03:14 importIgor Sysoev1-1/+3
2004-06-28nginx-0.0.7-2004-06-28-20:05:02 importIgor Sysoev1-1/+1
2004-06-27nginx-0.0.7-2004-06-27-22:01:57 importIgor Sysoev1-4/+5
2004-04-04nginx-0.0.3-2004-04-05-00:32:09 importIgor Sysoev1-0/+28