summaryrefslogtreecommitdiffhomepage
path: root/src/event (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-03-28Fixed --test-build-*.Ruslan Ermilov2-3/+4
Fixes various aspects of --test-build-devpoll, --test-build-eventport, and --test-build-epoll. In particular, if --test-build-devpoll was used on Linux, then "devpoll" event method would be preferred over "epoll". Also, wrong definitions of event macros were chosen.
2016-03-21Events: fixed test building with devpoll and eventport on Linux.Sergey Kandaurov2-1/+3
Avoid POLLREMOVE and itimerspec redefinition.
2016-03-18Threads: writing via threads pools in event pipe.Maxim Dounin2-20/+88
The "aio_write" directive is introduced, which enables use of aio for writing. Currently it is meaningful only with "aio threads". Note that aio operations can be done by both event pipe and output chain, so proper mapping between r->aio and p->aio is provided when calling ngx_event_pipe() and in output filter. In collaboration with Valentin Bartenev.
2016-03-18Fixed timeouts with threaded sendfile() and subrequests.Maxim Dounin1-0/+3
If a write event happens after sendfile() but before we've got the sendfile results in the main thread, this write event will be ignored. And if no more events will happen, the connection will hang. Removing the events works in the simple cases, but not always, as in some cases events are added back by an unrelated code. E.g., the upstream module adds write event in the ngx_http_upstream_init() to track client aborts. Fix is to use wev->complete instead. It is now set to 0 before a sendfile() task is posted, and it is set to 1 once a write event happens. If on completion of the sendfile() task wev->complete is 1, we know that an event happened while we were executing sendfile(), and the socket is still ready for writing even if sendfile() did not sent all the data or returned EAGAIN.
2016-01-20Stream: UDP proxy.Roman Arutyunyan5-65/+418
2016-03-15Events: fixed error logging in devpoll.Roman Arutyunyan1-1/+1
2016-02-19SSL: avoid calling SSL_shutdown() during handshake (ticket #901).Maxim Dounin1-0/+13
This fixes "called a function you should not call" and "shutdown while in init" errors as observed with OpenSSL 1.0.2f due to changes in how OpenSSL handles SSL_shutdown() during SSL handshakes.
2016-02-19SSL: fixed SSL_shutdown() comment.Maxim Dounin1-1/+1
2016-02-04Dynamic modules: changed ngx_modules to cycle->modules.Maxim Dounin1-21/+23
2016-02-04Dynamic modules: moved module-related stuff to separate files.Maxim Dounin1-8/+1
2015-10-20Win32: timer_resolution now ignored with select.Maxim Dounin1-0/+9
As setitimer() isn't available on Windows, time wasn't updated at all if timer_resolution was used with the select event method. Fix is to ignore timer_resolution in such cases.
2015-10-19SSL: preserve default server context in connection (ticket #235).Maxim Dounin2-12/+8
This context is needed for shared sessions cache to work in configurations with multiple virtual servers sharing the same port. Unfortunately, OpenSSL does not provide an API to access the session context, thus storing it separately. In collaboration with Vladimir Homutov.
2015-10-07SSL: handled long string truncation in ngx_ssl_error().Vladimir Homutov1-1/+1
If no space left in buffer after adding formatting symbols, error message could be left without terminating null. The fix is to output message using actual length.
2015-09-24SSL: compatibility with OpenSSL master branch.Maxim Dounin1-1/+3
RAND_pseudo_bytes() is deprecated in the OpenSSL master branch, so the only use was changed to RAND_bytes(). Access to internal structures is no longer possible, so now we don't try to set SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS even if it's defined.
2015-07-14OCSP stapling: fixed segfault without nextUpdate.Maxim Dounin1-5/+10
OCSP responses may contain no nextUpdate. As per RFC 6960, this means that nextUpdate checks should be bypassed. Handle this gracefully by using NGX_MAX_TIME_T_VALUE as "valid" in such a case. The problem was introduced by 6893a1007a7c (1.9.2). Reported by Matthew Baldwin.
2015-07-07OCSP stapling: fixed ssl_stapling_file (ticket #769).Maxim Dounin1-0/+1
Broken by 6893a1007a7c (1.9.2) during introduction of strict OCSP response validity checks. As stapling file is expected to be returned unconditionally, fix is to set its validity to the maximum supported time. Reported by Faidon Liambotis.
2015-06-11OCSP stapling: avoid sending expired responses (ticket #425).Maxim Dounin1-6/+62
2015-06-05Style.Maxim Dounin1-1/+2
2015-06-03Event pipe: call ngx_handle_read_event() with a proper flags type.Sergey Kandaurov1-1/+1
The change was missed in f69d1aab6a0f.
2015-05-21Fixed reuseport with accept_mutex.Maxim Dounin1-1/+6
2015-05-20The "reuseport" option of the "listen" directive.Maxim Dounin2-6/+25
When configured, an individual listen socket on a given address is created for each worker process. This allows to reduce in-kernel lock contention on configurations with high accept rates, resulting in better performance. As of now it works on Linux and DragonFly BSD. Note that on Linux incoming connection requests are currently tied up to a specific listen socket, and if some sockets are closed, connection requests will be reset, see https://lwn.net/Articles/542629/. With nginx, this may happen if the number of worker processes is reduced. There is no such problem on DragonFly BSD. Based on previous work by Sepherosa Ziehau and Yingqi Lu.
2015-05-15Events: ngx_event_t size reduction by grouping bit fields.Igor Sysoev1-9/+8
2015-05-06Events: made a failure to create a notification channel non-fatal.Ruslan Ermilov1-1/+1
This may happen if eventfd() returns ENOSYS, notably seen on CentOS 5.4. Such a failure will now just disable the notification mechanism and let the callers cope with it, instead of failing to start worker processes. If thread pools are not configured, this can safely be ignored.
2015-04-29Removed the deprecated "connections" directive.Ruslan Ermilov1-13/+0
2015-04-27Core: fixed nginx_shared_zone name.Maxim Dounin1-1/+1
2015-04-23Removed the obsolete rtsig module.Ruslan Ermilov4-825/+19
2015-04-22Removed the obsolete aio module.Ruslan Ermilov6-191/+9
2015-03-26Replaced the remaining NGX_OLD_THREADS check with NGX_WIN32.Ruslan Ermilov1-1/+3
2015-03-26Removed NGX_OLD_THREADS from select and poll modules.Ruslan Ermilov2-20/+0
These modules can't be compiled on win32.
2015-04-01OCSP stapling: missing free calls.Filipe da Silva1-0/+2
Missing call to X509_STORE_CTX_free when X509_STORE_CTX_init fails. Missing call to OCSP_CERTID_free when OCSP_request_add0_id fails. Possible leaks in vary particular scenariis of memory shortage.
2015-03-27Events: fixed possible crash on start or reload.Valentin Bartenev1-2/+2
The main thread could wake up and start processing the notify event before the handler was set.
2015-03-27Events: made posted events macros safe.Valentin Bartenev1-8/+8
2015-03-23Format specifier fixed for file size of buffers.Maxim Dounin1-4/+4
2015-03-23SSL: use of SSL_MODE_NO_AUTO_CHAIN.Maxim Dounin1-0/+4
The SSL_MODE_NO_AUTO_CHAIN mode prevents OpenSSL from automatically building a certificate chain on the fly if there is no certificate chain explicitly provided. Before this change, certificates provided via the ssl_client_certificate and ssl_trusted_certificate directives were used by OpenSSL to automatically build certificate chains, resulting in unexpected (and in some cases unneeded) chains being sent to clients.
2015-03-23SSL: clear protocol options.Maxim Dounin1-0/+8
LibreSSL 2.1.1+ started to set SSL_OP_NO_SSLv3 option by default on new contexts. This makes sure to clear it to make it possible to use SSLv3 with LibreSSL if enabled in nginx config. Prodded by Kuramoto Eiji.
2015-03-20Removed busy locks.Ruslan Ermilov4-430/+0
2015-03-20Removed ngx_connection_t.lock.Ruslan Ermilov2-8/+0
2015-03-20Removed unix ngx_threaded and related ngx_process_changes.Ruslan Ermilov12-98/+10
2015-03-20Removed old pthread implementation.Ruslan Ermilov1-50/+0
2015-03-14Events: implemented eventport notification mechanism.Ruslan Ermilov1-1/+34
2015-03-14Events: implemented kqueue notification mechanism.Valentin Bartenev1-0/+76
2015-03-14Events: implemented epoll notification mechanism.Valentin Bartenev1-2/+139
2015-03-14Thread pools implementation.Valentin Bartenev12-1/+15
2015-03-04Renamed NGX_THREADS to NGX_OLD_THREADS because of deprecation.Ruslan Ermilov7-10/+10
It's mostly dead code and the original idea of worker threads has been rejected.
2015-03-12Events: fixed typo in the error message.Ruslan Ermilov1-1/+1
2015-03-03Events: simplified ngx_event_aio_t definition.Ruslan Ermilov1-4/+2
No functional changes.
2015-02-24SSL: account sent bytes in ngx_ssl_write().Ruslan Ermilov1-2/+2
2015-02-11Refactored sendfile() AIO preload.Valentin Bartenev1-4/+4
This reduces layering violation and simplifies the logic of AIO preread, since it's now triggered by the send chain function itself without falling back to the copy filter. The context of AIO operation is now stored per file buffer, which makes it possible to properly handle cases when multiple buffers come from different locations, each with its own configuration.
2014-12-17SSL: safeguard use of SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS.Lukas Tribus1-0/+4
The flag was recently removed by BoringSSL.
2014-08-04SSL: loading certificate keys via ENGINE_load_private_key().Dmitrii Pichulin1-0/+61