summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-09-05Events: removed unused flags from the ngx_event_s structure.Valentin Bartenev1-4/+0
They are not used since 708f8bb772ec (pre 0.0.1).
2013-09-05Fixed handling of the ready flag with kqueue.Valentin Bartenev2-0/+2
There is nothing to do more when recv() has returned 0, so we should drop the flag.
2013-09-03Return reason phrase for 414.Valentin Bartenev1-4/+1
After 62be77b0608f nginx can return this code.
2013-09-04Upstream: fixed $upstream_response_time format specifiers.Maxim Dounin1-1/+1
2013-09-04SSL: clear error queue after SSL_CTX_load_verify_locations().Maxim Dounin1-0/+14
The SSL_CTX_load_verify_locations() may leave errors in the error queue while returning success (e.g. if there are duplicate certificates in the file specified), resulting in "ignoring stale global SSL error" alerts later at runtime.
2013-09-04Fixed incorrect response line on "return 203".Maxim Dounin1-0/+6
Reported by Weibin Yao, http://mailman.nginx.org/pipermail/nginx-devel/2013-April/003607.html.
2013-09-04Request cleanup code unified, no functional changes.Maxim Dounin1-1/+6
Additionally, detaching a cleanup chain from a request is a bit more resilent to various bugs if any.
2013-09-04Handling of ngx_int_t != intptr_t case.Maxim Dounin3-6/+7
Casts between pointers and integers produce warnings on size mismatch. To silence them, cast to (u)intptr_t should be used. Prevoiusly, casts to ngx_(u)int_t were used in some cases, and several ngx_int_t expressions had no casts. As of now it's mostly style as ngx_int_t is defined as intptr_t.
2013-09-04Win32: $request_time fixed.Maxim Dounin2-2/+2
On win32, time_t is 64 bits wide by default, and passing an ngx_msec_int_t argument for %T format specifier doesn't work. This doesn't manifest itself on other platforms as time_t and ngx_msec_int_t are usually of the same size.
2013-09-04Win32: MinGW GCC compatibility.Maxim Dounin14-21/+31
Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
2013-09-04Win32: Borland C compatibility fixes.Maxim Dounin8-13/+25
Several false positive warnings silenced, notably W8012 "Comparing signed and unsigned" (due to u_short values promoted to int), and W8072 "Suspicious pointer arithmetic" (due to large type values added to pointers). With this patch, it's now again possible to compile nginx using bcc32, with options we normally compile on win32 minus ipv6 and ssl.
2013-09-04Win32: Open Watcom C compatibility fixes.Maxim Dounin3-2/+16
Precompiled headers are disabled as they lead to internal compiler errors with long configure lines. Couple of false positive warnings silenced. Various win32 typedefs are adjusted to work with Open Watcom C 1.9 headers. With this patch, it's now again possible to compile nginx using owc386, with options we normally compile on win32 minus ipv6 and ssl.
2013-09-02Disable symlinks: removed recursive call of ngx_file_o_path_info().Valentin Bartenev1-1/+0
It is surplus.
2013-09-02Disable symlinks: use O_PATH to open path components.Valentin Bartenev2-0/+70
It was introduced in Linux 2.6.39, glibc 2.14 and allows to obtain file descriptors without actually opening files. Thus made it possible to traverse path with openat() syscalls without the need to have read permissions for path components. It is effectively emulates O_SEARCH which is missing on Linux. O_PATH is used in combination with O_RDONLY. The last one is ignored if O_PATH is used, but it allows nginx to not fail when it was built on modern system (i.e. glibc 2.14+) and run with a kernel older than 2.6.39. Then O_PATH is unknown to the kernel and ignored, while O_RDONLY is used. Sadly, fstat() is not working with O_PATH descriptors till Linux 3.6. As a workaround we fallback to fstatat() with the AT_EMPTY_PATH flag that was introduced at the same time as O_PATH.
2013-09-02Added the NGX_EBADF define.Valentin Bartenev3-1/+3
2013-09-02Assume the HTTP/1.0 version by default.Valentin Bartenev1-0/+1
It is believed to be better than fallback to HTTP/0.9, because most of the clients at present time support HTTP/1.0. It allows nginx to return error response code for them in cases when it fail to parse request line, and therefore fail to detect client protocol version. Even if the client does not support HTTP/1.0, this assumption should not cause any harm, since from the HTTP/0.9 point of view it still a valid response.
2013-08-30Upstream: setting u->header_sent before ngx_http_upstream_upgrade().Maxim Dounin1-2/+2
Without u->header_sent set a special response might be generated following an upgraded connection. The problem appeared in 1ccdda1f37f3 (1.5.3). Catched by "header already sent" alerts in 1.5.4 after upstream timeouts.
2013-08-29Referer: fixed hostname buffer overflow check.Valentin Bartenev1-3/+3
Because of premature check the effective buffer size was 255 symbols while the buffer is able to handle 256.
2013-08-29Referer: "server_names" parsing deferred to merge phase.Sergey Kandaurov1-33/+45
This allows to approach "server_name" values specified below the "valid_referers" directive when used within the "server_names" parameter, e.g.: server_name example.org; valid_referers server_names; server_name example.com; As a bonus, this fixes bogus error with "server_names" specified several times.
2013-08-29Referer: fixed server_name regex matching.Sergey Kandaurov1-22/+67
The server_name regexes are normally compiled for case-sensitive matching. This violates case-insensitive obligations in the referer module. To fix this, the host string is converted to lower case before matching. Previously server_name regex was executed against the whole referer string after dropping the scheme part. This could led to an improper matching, e.g.: server_name ~^localhost$; valid_referers server_names; Referer: http://localhost/index.html It was changed to look only at the hostname part. The server_name regexes are separated into another array to not clash with regular regexes.
2013-08-29Referer: fixed error type usage inconsistency for ngx_http_add*().Sergey Kandaurov1-15/+15
2013-08-28Image filter: large image handling.Lanshun Zhou1-1/+6
If Content-Length header is not set, and the image size is larger than the buffer size, client will hang until a timeout occurs. Now NGX_HTTP_UNSUPPORTED_MEDIA_TYPE is returned immediately. diff -r d1403de41631 -r 4fae04f332b4 src/http/modules/ngx_http_image_filter_module.c
2013-08-28Typo fixed.Maxim Dounin1-2/+2
2013-08-28Version bump.Maxim Dounin1-2/+2
2013-08-23Cache: lock timeouts are now logged at info level.Maxim Dounin1-2/+1
2013-08-23Upstream: posted requests handling after ssl handshake errors.Maxim Dounin1-0/+6
Missing call to ngx_http_run_posted_request() resulted in a main request hang if subrequest's ssl handshake with an upstream server failed for some reason. Reported by Aviram Cohen.
2013-08-23Fixed try_files with empty argument (ticket #390).Maxim Dounin1-1/+3
2013-07-30Added safety belt for the case of sending header twice.Sergey Kandaurov1-0/+6
The aforementioned situation is abnormal per se and as such it now forces request termination with appropriate error message.
2013-07-30Autoindex: improved ngx_de_info() error handling.Sergey Kandaurov3-2/+3
This allows to build a directory listing whenever a loop exists in symbolic link resolution of the path argument.
2013-07-30Autoindex: return NGX_ERROR on error if headers were sent.Sergey Kandaurov1-2/+2
This prevents ngx_http_finalize_request() from issuing ngx_http_special_response_handler() on a freed context.
2013-08-20Style improved after 12dd27b74117.Maxim Dounin2-12/+10
2013-08-20Backed out f1a91825730a and 7094bd12c1ff.Maxim Dounin13-45/+34
While ngx_get_full_name() might have a bit more descriptive arguments, the ngx_conf_full_name() is generally easier to use when parsing configuration and limits exposure of cycle->prefix / cycle->conf_prefix details.
2013-08-21Auth request module import.Maxim Dounin1-0/+444
2013-08-21Minor ngx_http_parse_request_line() optimization.Maxim Dounin1-0/+3
Noted by Nils Kuhnhenn.
2013-08-20Format specifier fixes in error logging.Sergey Kandaurov5-6/+6
2013-08-15SPDY: alert about activated fake events instead of deleting them.Valentin Bartenev1-2/+4
They refer to the same socket descriptor as our real connection, and deleting them will stop processing of the connection. Events of fake connections must not be activated, and if it happened there is nothing we can do. The whole processing should be terminated as soon as possible, but it is not obvious how to do this safely.
2013-08-15SPDY: do not reject headers with empty value (ticket #396).Valentin Bartenev1-4/+0
A quote from SPDY draft 2 specification: "The length of each name and value must be greater than zero. A receiver of a zero-length name or value must send a RST_STREAM with code PROTOCOL error." But it appears that Chrome browser allows sending requests over SPDY/2 connection using JavaScript that contain headers with empty values. For better compatibility across SPDY clients and to be compliant with HTTP, such headers are no longer rejected. Also, it is worth noting that in SPDY draft 3 the statement has been changed so that it permits empty values for headers.
2013-08-15SPDY: fixed corruption of headers with names longer than 255.Valentin Bartenev1-2/+16
It is a bad idea to put zero byte in position where the length of the next header name can be stored before it was parsed.
2013-08-15Unbreak building on Linux without sendfile64() support.Valentin Bartenev1-3/+3
It was broken in 8e446a2daf48 when the NGX_SENDFILE_LIMIT constant was added to ngx_linux_sendfile_chain.c having the same name as already defined one in ngx_linux_config.h. The newer is needed to overcome a bug in old Linux kernels by limiting the number of bytes to send per sendfile() syscall. The older is used with sendfile() on ancient kernels that works with 32-bit offsets only. One of these renamed to NGX_SENDFILE_MAXSIZE.
2013-08-13Referer module: fixed regex matching against HTTPS referers.Sergey Kandaurov1-1/+3
When matching a compiled regex against value in the "Referer" header field, the length was calculated incorrectly for strings that start from "https://". This might cause matching to fail for regexes with end-of-line anchors. Patch by Liangbin Li.
2013-08-08Don't lose pointer to first nonempty buf in ngx_*_sendfile_chain().Gleb Smirnoff4-66/+58
In ngx_*_sendfile_chain() when calculating pointer to a first non-zero sized buf, use "in" as iterator. This fixes processing of zero sized buf(s) after EINTR. Otherwise function can return zero sized buf to caller, and later ngx_http_write_filter() logs warning.
2013-08-06API change: removed the ngx_conf_full_name() function.Valentin Bartenev2-12/+0
The ngx_get_full_name() should be used instead.
2013-08-06Replaced ngx_conf_full_name() with ngx_get_full_name().Valentin Bartenev12-22/+45
The ngx_get_full_name() function takes more readable arguments list.
2013-08-06Fixed memory leaks in the root and auth_basic_user_file directives.Valentin Bartenev6-94/+112
If a relative path is set by variables, then the ngx_conf_full_name() function was called while processing requests, which causes allocations from the cycle pool. A new function that takes pool as an argument was introduced.
2013-08-05Image filter: use "application/json" MIME type for JSON output.Valentin Bartenev1-1/+1
As it is defined by RFC 4627, and allows for various browser tools like JSONView to display JSON well-formatted.
2013-08-05Core: guard use of AI_ADDRCONFIG.Ruslan Ermilov1-0/+2
Some systems (notably NetBSD and OpenBSD) lack AI_ADDRCONFIG support. Reported by Piotr Sikora.
2013-08-05Fixed build with signed socklen_t and unix sockets.Maxim Dounin1-1/+1
This seems to be the case at least under Cygwin, where build was broken by 05ba5bce31e0 (1.5.3). Reported by Kevin Worthington, http://mailman.nginx.org/pipermail/nginx/2013-August/040028.html.
2013-08-05Core: only resolve address families configured on the local system.Ruslan Ermilov1-0/+1
This is done by passing AI_ADDRCONFIG to getaddrinfo(). On Linux, setting net.ipv6.conf.all.disable_ipv6 to 1 will now be respected. On FreeBSD, AI_ADDRCONFIG filtering is currently implemented by attempting to create a datagram socket for the corresponding family, which succeeds even if the system doesn't in fact have any addresses of that family configured. That is, if the system with IPv6 support in the kernel doesn't have IPv6 addresses configured, AI_ADDRCONFIG will filter out IPv6 only inside a jail without IPv6 addresses or with IPv6 disabled.
2013-07-31MIME: use "application/javascript" for .js files.Valentin Bartenev1-1/+1
Though there are several MIME types commonly used for JavaScript nowadays, the most common being "text/javascript", "application/javascript", and currently used by nginx "application/x-javascript", RFC 4329 prefers "application/javascript". The "charset_types" directive's default value was adjusted accordingly.
2013-07-31Version bump.Sergey Kandaurov1-2/+2