summaryrefslogtreecommitdiffhomepage
path: root/src/event (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-09-30Merging r4011, r4012, r4136:Igor Sysoev1-2/+2
Proxy related fixes: *) Fixing cpu hog with all upstream servers marked "down". The following configuration causes nginx to hog cpu due to infinite loop in ngx_http_upstream_get_peer(): upstream backend { server 127.0.0.1:8080 down; server 127.0.0.1:8080 down; } server { ... location / { proxy_pass http://backend; } } Make sure we don't loop infinitely in ngx_http_upstream_get_peer() but stop after resetting peer weights once. Return 0 if we are stuck. This is guaranteed to work as peer 0 always exists, and eventually ngx_http_upstream_get_round_robin_peer() will do the right thing falling back to backup servers or returning NGX_BUSY. *) Upstream: properly allocate memory for tried flags. Previous allocation only took into account number of non-backup servers, and this caused memory corruption with many backup servers. See report here: http://mailman.nginx.org/pipermail/nginx/2011-May/026531.html *) Fix of cpu hog in event pipe. If client closed connection in ngx_event_pipe_write_to_downstream(), buffers in the "out" chain were lost. This caused cpu hog if all available buffers were in the "out" chain. Fix is to call ngx_chain_update_chains() before checking return code of output filter to avoid loosing buffers in the "out" chain. Note that this situation (all available buffers in the "out" chain) isn't normal, it should be prevented by busy buffers limit. Though right now it may happen with complex protocols like fastcgi. This should be addressed separately.
2011-09-30Merging r4130, r4131, r4135:Igor Sysoev1-53/+99
Linux AIO related fixes: *) Fixing Linux AIO syscalls return value handling: syscall(2) uses usual libc convention, it returns -1 on error and sets errno. Obsolete _syscall(2) returns negative value of error. *) Fixing Linux AIO initiatialization: AIO operations are disabled if kernel does not support them. Previously worker just exited. *) The "worker_aio_requests" directive. The default value is 32 AIO simultaneous requests per worker. Previously they were hardcoded to 1024, and it was too large, since Linux allocated them early on io_setup(), but not on request itself. So with default value of /proc/sys/fs/aio-max-nr equal to 65536 only 64 worker processes could be run simultaneously. 32 AIO requests are enough for modern disks even if server runs only 1 worker.
2011-09-30Merging r4010, r4065:Igor Sysoev1-0/+5
SSL related fixes: *) Fixing proxy_set_body and proxy_pass_request_body with SSL. Flush flag wasn't set in constructed buffer and this prevented any data from being actually sent to upstream due to SSL buffering. Make sure we always set flush in the last buffer we are going to sent. See here for report: http://nginx.org/pipermail/nginx-ru/2011-June/041552.html *) Proper SSL shutdown handling. If connection has unsent alerts, SSL_shutdown() tries to send them even if SSL_set_shutdown(SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN) was used. This can be prevented by SSL_set_quiet_shutdown(). SSL_set_shutdown() is required nevertheless to preserve session.
2011-09-30Merging r3933, r4154:Igor Sysoev2-5/+3
A new fix for the case when ssl_session_cache defined, but ssl is not enabled in any server. The previous r1033 does not help when unused zone becomes used after reconfiguration, so it is backed out. The initial thought was to make SSL modules independed from SSL implementation and to keep OpenSSL code dependance as much as in separate files.
2011-08-29Merge of r3960, r3961, r3962, r3963, r3965:Igor Sysoev2-25/+59
SSL related fixes: *) MSIE export versions are rare now, so RSA 512 key is generated on demand and is shared among all hosts instead of pregenerating for every HTTPS host on configuraiton phase. This decreases start time for configuration with large number of HTTPS hosts. *) ECDHE support; patch by Adrian Kotelba *) fix build by gcc46 with -Wunused-value option *) fix SSL connection issues on platforms with 32-bit off_t *) do not try to reuse and save a SSL session for a peer created on the fly by ngx_http_upstream_create_round_robin_peer(), since the peer lives only during request so the saved SSL session will never be used again and just causes memory leak
2011-05-10use POSIX semaphores in shmtx instead of sched_yield()Igor Sysoev1-0/+1
number of spinlock spins are increased twice
2011-04-23fix building by gcc 4.6 without --with-debugIgor Sysoev1-10/+3
2011-01-20fix building on Fedora 14Igor Sysoev1-1/+1
patch by Kirill A. Korinskiy
2010-12-06remove SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG becuase of CVE-2010-4180Igor Sysoev1-1/+0
2010-12-02fix building by msvc8 introduced by the previous commitIgor Sysoev1-3/+5
2010-12-02fallback to accept() if accept4() is not implemented,Igor Sysoev1-2/+21
the issue has been introduced in r3787
2010-11-25Linux accept4() supportIgor Sysoev1-0/+4
2010-07-29decrease SSL handshake error level to infoIgor Sysoev1-1/+2
2010-05-14ngx_str_set() and ngx_str_null()Igor Sysoev1-7/+3
2010-04-01MSVC8 compatibility with OpenSSL 1.0.0Igor Sysoev1-0/+3
2010-03-25*) introduce ngx_time_sigsafe_update() to update the error log time onlyIgor Sysoev9-15/+15
*) change ngx_time_update() interface
2010-03-13*) use previously cached GMT offset value to update time from a signal handlerIgor Sysoev9-15/+15
*) change ngx_time_update() interface since there are no notification methods those return time
2010-03-12do not update time in the timer signal handler,Igor Sysoev6-7/+5
since localtime_r() is not Async-Signal-Safe function
2010-03-03add OpenSSL_add_all_algorithms(), this fixes the errorIgor Sysoev2-0/+4
"ASN1_item_verify:unknown message digest algorithm" occurred if client certificate is signed using sha256WithRSAEncryption
2010-03-02Set SSL session context for "ssl_session_cache none".Igor Sysoev1-2/+2
This fixes a bug when client certficate is used and nginx closes connection with the message: "SSL_GET_PREV_SESSION:session id context uninitialized".
2010-02-19decrease SSL handshake error level to infoIgor Sysoev1-0/+4
2009-11-25update commentsIgor Sysoev1-9/+4
2009-11-23add NGX_PROCESS_HELPER process statusIgor Sysoev3-3/+3
2009-11-23decrease SSL handshake error level to infoIgor Sysoev1-0/+1
2009-11-11disable SSL renegotiation (CVE-2009-3555)Igor Sysoev2-0/+41
2009-11-03fix segfault in SSL if limit_rate is usedIgor Sysoev1-3/+2
2009-11-02proxy_bind, fastcgi_bind, and memcached_bindIgor Sysoev2-19/+26
2009-11-02style fixIgor Sysoev1-1/+0
2009-11-01delete unused field c->local_socklenIgor Sysoev2-2/+2
2009-10-26http listen unix domain socketsIgor Sysoev1-0/+11
2009-09-24fix r3155Igor Sysoev1-1/+1
2009-09-24fix debug log messageIgor Sysoev1-3/+3
2009-09-24$ssl_session_idIgor Sysoev2-0/+36
2009-08-30aio sendfileIgor Sysoev1-0/+4
2009-08-28FreeBSD and Linux AIO supportIgor Sysoev3-4/+265
2009-08-26axe r->connection->destroyed testingIgor Sysoev1-12/+0
2009-08-25*) move small declarations in appropriate places and delete the surplusIgor Sysoev4-25/+2
header files *) delete insignificant comments
2009-08-25style fixIgor Sysoev7-32/+6
2009-08-21*) share temporary number between workersIgor Sysoev1-13/+21
*) randomize collision offset
2009-07-27fix memory corruption in $ssl_client_certIgor Sysoev1-1/+1
2009-07-23delete ancient defineIgor Sysoev1-2/+0
2009-07-23delete OpenSSL pre-0.9.7 compatibility: the sources were not actuallyIgor Sysoev2-23/+0
compatible with OpenSSL 0.9.6 since ssl_session_cache introduction
2009-07-23ssl_crlIgor Sysoev2-0/+46
2009-07-22*) $ssl_client_verifyIgor Sysoev2-0/+31
*) "ssl_verify_client ask" was changed to "ssl_verify_client optional"
2009-06-18ignore ngx_atomic_fetch_add() resultIgor Sysoev1-4/+4
this fixes building at least by gcc 4.2.1 on Mac OS X 10.6
2009-06-02return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev7-8/+8
2009-05-14style fixIgor Sysoev1-2/+4
2009-05-06divide select module into two modules: Unix and Win32 onesIgor Sysoev2-137/+404
2009-05-06make code clearerIgor Sysoev1-2/+4
2009-05-06test event type to prevent errorsIgor Sysoev1-0/+10