aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
* Mp4: fixed handling of too small mdat atoms (ticket #266).Maxim Dounin2013-03-04
| | | | Patch by Gernot Vormayr (with minor changes).
* Allocate request object from its own pool.Valentin Bartenev2013-03-01
| | | | | | | | Previously, it was allocated from a connection pool and was selectively freed for an idle keepalive connection. The goal is to put coupled things in one chunk of memory, and to simplify handling of request objects.
* SNI: added restriction on requesting host other than negotiated.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to RFC 6066, client is not supposed to request a different server name at the application layer. Server implementations that rely upon these names being equal must validate that a client did not send a different name in HTTP request. Current versions of Apache HTTP server always return 400 "Bad Request" in such cases. There exist implementations however (e.g., SPDY) that rely on being able to request different host names in one connection. Given this, we only reject requests with differing host names if verification of client certificates is enabled in a corresponding server configuration. An example of configuration that might not work as expected: server { listen 433 ssl default; return 404; } server { listen 433 ssl; server_name example.org; ssl_client_certificate org.cert; ssl_verify_client on; } server { listen 433 ssl; server_name example.com; ssl_client_certificate com.cert; ssl_verify_client on; } Previously, a client was able to request example.com by presenting a certificate for example.org, and vice versa.
* SNI: reset to default server if requested host was not found.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | Not only this is consistent with a case without SNI, but this also prevents abusing configurations that assume that the $host variable is limited to one of the configured names for a server. An example of potentially unsafe configuration: server { listen 443 ssl default_server; ... } server { listen 443; server_name example.com; location / { proxy_pass http://$host; } } Note: it is possible to negotiate "example.com" by SNI, and to request arbitrary host name that does not exist in the configuration above.
* SNI: avoid surplus lookup of virtual server if SNI was used.Valentin Bartenev2013-02-27
|
* Apply server configuration as soon as host is known.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | Previously, this was done only after the whole request header was parsed, and if an error occurred earlier then the request was processed in the default server (or server chosen by SNI), while r->headers_in.server might be set to the value from the Host: header or host from request line. r->headers_in.server is in turn used for $host variable and in HTTP redirects if "server_name_in_redirect" is disabled. Without the change, configurations that rely on this during error handling are potentially unsafe if SNI is used. This change also allows to use server specific settings of "underscores_in_headers", "ignore_invalid_headers", and "large_client_header_buffers" directives for HTTP requests and HTTPS requests without SNI.
* SSL: do not treat SSL handshake as request.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | The request object will not be created until SSL handshake is complete. This simplifies adding another connection handler that does not need request object right after handshake (e.g., SPDY). There are also a few more intentional effects: - the "client_header_buffer_size" directive will be taken from the server configuration that was negotiated by SNI; - SSL handshake errors and timeouts are not logged into access log as bad requests; - ngx_ssl_create_connection() is not called until the first byte of ClientHello message was received. This also decreases memory consumption if plain HTTP request is sent to SSL socket.
* Status: do not count connection as reading right after accept().Valentin Bartenev2013-02-27
| | | | | | | Before we receive the first bytes, the connection is counted as waiting. This change simplifies further code changes.
* SNI: reuse selected configuration for all requests in a connection.Valentin Bartenev2013-02-27
| | | | | | | | | | | | | | | | | | Previously, only the first request in a connection was assigned the configuration selected by SNI. All subsequent requests initially used the default server's configuration, ignoring SNI, which was wrong. Now all subsequent requests in a connection will initially use the configuration selected by SNI. This is done by storing a pointer to configuration in http connection object. It points to default server's configuration initially, but changed upon receipt of SNI. (The request's configuration can be further refined when parsing the request line and Host: header.) This change was not made specific to SNI as it also allows slightly faster access to configuration without the request object.
* SNI: ignore captures in server_name regexes when matching by SNI.Valentin Bartenev2013-02-27
| | | | | | | | This change helps to decouple ngx_http_ssl_servername() from the request object. Note: now we close connection in case of error during server name lookup for request. Previously, we did so only for HTTP/0.9 requests.
* Changed interface of ngx_http_validate_host().Valentin Bartenev2013-02-27
|
* Introduced the ngx_http_set_connection_log() macro.Valentin Bartenev2013-02-27
| | | | No functional changes.
* The default server lookup is now done only once per connection.Valentin Bartenev2013-02-27
| | | | Previously, it was done for every request in a connection.
* Correctly handle multiple X-Forwarded-For headers (ticket #106).Ruslan Ermilov2013-02-27
|
* Fixed separator in $sent_http_cache_control.Ruslan Ermilov2013-02-27
| | | | | | In case multiple "Cache-Control" headers are sent to a client, multiple values in $sent_http_cache_control were incorrectly split by a semicolon. Now they are split by a comma.
* Fixed potential segfault in ngx_http_keepalive_handler().Valentin Bartenev2013-02-23
| | | | | | | | In case of error in the read event handling we close a connection by calling ngx_http_close_connection(), that also destroys connection pool. Thereafter, an attempt to free a buffer (added in r4892) that was allocated from the pool could cause SIGSEGV and is meaningless as well (the buffer already freed with the pool).
* SSL: retry "sess_id" and "id" allocations.Maxim Dounin2013-02-23
| | | | | | | | | | | | | In case of fully populated SSL session cache with no memory left for new allocations, ngx_ssl_new_session() will try to expire the oldest non-expired session and retry, but only in case when slab allocation fails for "cached_sess", not when slab allocation fails for either "sess_id" or "id", which can happen for number of reasons and results in new session not being cached. Patch fixes this by adding retry logic to "sess_id" & "id" allocations. Patch by Piotr Sikora.
* Trailing whitespace fix.Maxim Dounin2013-02-23
|
* Introduced variables in ngx_http_stub_status module.Andrey Belov2013-02-21
| | | | | Three new variables were added: $connections_active, $connections_reading and $connections_writing.
* Connection upgrade support in uwsgi and scgi modules.Maxim Dounin2013-02-20
| | | | Prodded by Roberto De Ioris.
* Removed zero termination of shm zone names.Valentin Bartenev2013-02-19
| | | | | | | It was added in r2717 and no longer needed since r2721, where the termination was added to ngx_shm_alloc() and ngx_init_zone_pool(). So then it only corrupts error messages about ivalid zones.
* Version bump.Valentin Bartenev2013-02-19
|
* Proxy: fixed do_write handling in previous commit.Maxim Dounin2013-02-18
| | | | | As rightfully complained by MSVC, do_write variable was used uninitialized. Correct fix is to set it's initial value based on event happened.
* Proxy: support for connection upgrade (101 Switching Protocols).Maxim Dounin2013-02-18
| | | | | | | | | | | | | | This allows to proxy WebSockets by using configuration like this: location /chat/ { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } Connection upgrade is allowed as long as it was requested by a client via the Upgrade request header.
* Fixed false memset warning on Linux with -O3 (ticket #275).Maxim Dounin2013-02-13
| | | | Prodded by John Leach.
* Added support for {SHA} passwords (ticket #50).Maxim Dounin2013-02-07
| | | | | | | | | | | | Note: use of {SHA} passwords is discouraged as {SHA} password scheme is vulnerable to attacks using rainbow tables. Use of {SSHA}, $apr1$ or crypt() algorithms as supported by OS is recommended instead. The {SHA} password scheme support is added to avoid the need of changing the scheme recorded in password files from {SHA} to {SSHA} because such a change hides security problem with {SHA} passwords. Patch by Louis Opter, with minor changes.
* Version bump.Maxim Dounin2013-02-07
|
* GeoIP: removed pseudo-support of "proxy" and "netspeed" databases.Ruslan Ermilov2013-02-04
|
* FastCGI: proper handling of split fastcgi end request.Maxim Dounin2013-02-01
| | | | | | If fastcgi end request record was split between several network packets, with fastcgi_keep_conn it was possible that connection was saved in incorrect state (e.g. with padding bytes not yet read).
* FastCGI: unconditional state transitions.Maxim Dounin2013-02-01
| | | | | | Checks for f->padding before state transitions make code hard to follow, remove them and make sure we always do another loop iteration after f->state is set to ngx_http_fastcgi_st_padding.
* FastCGI: fixed wrong connection close with fastcgi_keep_conn.Maxim Dounin2013-02-01
| | | | | | | | | | With fastcgi_keep_conn it was possible that connection was closed after FCGI_STDERR record with zero padding and without any further data read yet. This happended as f->state was set to ngx_http_fastcgi_st_padding and then "break" happened, resulting in p->length being set to f->padding, i.e. 0 (which in turn resulted in connection close). Fix is to make sure we continue the loop after f->state is set.
* Request body: fixed client_body_in_file_only.Maxim Dounin2013-02-01
| | | | | | | | After introduction of chunked request body reading support in 1.3.9 (r4931), the rb->bufs wasn't set if request body was fully preread while calling the ngx_http_read_client_request_body() function. Reported by Yichun Zhang (agentzh).
* SSL: fixed ngx_ssl_handshake() with level-triggered event methods.Maxim Dounin2013-02-01
| | | | | | Missing calls to ngx_handle_write_event() and ngx_handle_read_event() resulted in a CPU hog during SSL handshake if an level-triggered event method (e.g. select) was used.
* SSL: take into account data in the buffer while limiting output.Valentin Bartenev2013-01-28
| | | | In some rare cases this can result in a more smooth sending rate.
* SSL: avoid calling SSL_write() with zero data size.Valentin Bartenev2013-01-28
| | | | | | | | | | | | 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.
* SSL: calculation of buffer size moved closer to its usage.Valentin Bartenev2013-01-28
| | | | No functional changes.
* SSL: preservation of flush flag for buffered data.Valentin Bartenev2013-01-28
| | | | | Previously, if SSL buffer was not sent we lost information that the data must be flushed.
* SSL: resetting of flush flag after the data was written.Valentin Bartenev2013-01-28
| | | | | 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.
* SSL: removed conditions that always hold true.Valentin Bartenev2013-01-28
|
* Secure_link: fixed configuration inheritance.Ruslan Ermilov2013-01-28
| | | | | | The "secure_link_secret" directive was always inherited from the outer configuration level even when "secure_link" and "secure_link_md5" were specified on the inner level.
* Events: fixed null pointer dereference with resolver and poll.Ruslan Ermilov2013-01-25
| | | | | | | A POLLERR signalled by poll() without POLLIN/POLLOUT, as seen on Linux, would generate both read and write events, but there's no write event handler for resolver events. A fix is to only call event handler of an active event.
* GeoIP: IPv6 support.Ruslan Ermilov2013-01-24
| | | | | | | When using IPv6 databases, IPv4 addresses are looked up as IPv4-mapped IPv6 addresses. Mostly based on a patch by Gregor Kališnik (ticket #250).
* Proxy: fixed proxy_method to always add space.Maxim Dounin2013-01-22
| | | | | | Before the patch if proxy_method was specified at http{} level the code to add trailing space wasn't executed, resulting in incorrect requests to upstream.
* Variables $pipe, $request_length, $time_iso8601, and $time_local.Ruslan Ermilov2013-01-21
| | | | | | Log module counterparts are preserved for efficiency. Based on patch by Kiril Kalchev.
* Version bump.Ruslan Ermilov2013-01-17
|
* Fixed and improved the "*_bind" directives of proxying modules.Ruslan Ermilov2013-01-16
| | | | | | | The "proxy_bind", "fastcgi_bind", "uwsgi_bind", "scgi_bind" and "memcached_bind" directives are now inherited; inherited value can be reset by the "off" parameter. Duplicate directives are now detected. Parameter value can now contain variables.
* Fixed "proxy_pass" with IP address and no port (ticket #276).Ruslan Ermilov2013-01-10
| | | | | | | | | Upstreams created by "proxy_pass" with IP address and no port were broken in 1.3.10, by not initializing port in u->sockaddr. API change: ngx_parse_url() was modified to always initialize port (in u->sockaddr and in u->port), even for the u->no_resolve case; ngx_http_upstream() and ngx_http_upstream_add() were adopted.
* SSL: speedup loading of configs with many ssl servers.Maxim Dounin2013-01-09
| | | | | | | | | The patch saves one EC_KEY_generate_key() call per server{} block by informing OpenSSL about SSL_OP_SINGLE_ECDH_USE we are going to use before the SSL_CTX_set_tmp_ecdh() call. For a configuration file with 10k simple server{} blocks with SSL enabled this change reduces startup time from 18s to 5s on a slow test box here.
* Events: added check for duplicate "events" directive.Valentin Bartenev2013-01-08
|
* The data pointer in ngx_open_file_t objects must be initialized.Valentin Bartenev2013-01-08
| | | | | | | Uninitialized pointer may result in arbitrary segfaults if access_log is used without buffer and without variables in file path. Patch by Tatsuhiko Kubo (ticket #268).