summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_times.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-10-21Removed CLOCK_MONOTONIC_COARSE support.Maxim Dounin1-4/+0
While clock_gettime(CLOCK_MONOTONIC_COARSE) is faster than clock_gettime(CLOCK_MONOTONIC), the latter is fast enough on Linux for practical usage, and the difference is negligible compared to other costs at each event loop iteration. On the other hand, CLOCK_MONOTONIC_COARSE causes various issues with typical CONFIG_HZ=250, notably very inaccurate limit_rate handling in some edge cases (ticket #1678) and negative difference between $request_time and $upstream_response_time (ticket #1965).
2018-03-01Core: ngx_current_msec now uses monotonic time if available.Maxim Dounin1-1/+29
When clock_gettime(CLOCK_MONOTONIC) (or faster variants, _FAST on FreeBSD, and _COARSE on Linux) is available, we now use it for ngx_current_msec. This should improve handling of timers if system time changes (ticket #189).
2017-09-13Introduced time truncation to December 31, 9999 (ticket #1368).Maxim Dounin1-0/+10
Various buffers are allocated in an assumption that there would be no more than 4 year digits. This might not be true on platforms with 64-bit time_t, as 64-bit time_t is able to represent more than that. Such dates with more than 4 year digits hardly make sense though, as various date formats in use do not allow them anyway. As such, all dates are now truncated by ngx_gmtime() to December 31, 9999. This should have no effect on valid dates, though will prevent potential buffer overflows on invalid ones.
2017-09-13Fixed ngx_gmtime() on 32-bit platforms with 64-bit time_t.Maxim Dounin1-8/+10
In ngx_gmtime(), instead of casting to ngx_uint_t we now work with time_t directly. This allows using dates after 2038 on 32-bit platforms which use 64-bit time_t, notably NetBSD and OpenBSD. As the code is not able to work with negative time_t values, argument is now set to 0 for negative values. As a positive side effect, this results in Epoch being used for such values instead of a date in distant future.
2017-09-13Fixed reference to time parsing code after 8b6fa4842133.Maxim Dounin1-1/+1
2016-03-31Fixed format specifiers in ngx_sprintf().Sergey Kandaurov1-2/+2
2014-05-12Added syslog support for error_log and access_log directives.Vladimir Homutov1-2/+19
2012-08-03Fixed possible use of old cached times if runtime went backwards.Maxim Dounin1-0/+4
If ngx_time_sigsafe_update() updated only ngx_cached_err_log_time, and then clock was adjusted backwards, the cached_time[slot].sec might accidentally match current seconds on next ngx_time_update() call, resulting in various cached times not being updated. Fix is to clear the cached_time[slot].sec to explicitly mark cached times are stale and need updating.
2012-04-03Fixed spelling in multiline C comments.Ruslan Ermilov1-2/+2
2012-02-28Fixed spelling in single-line comments.Ruslan Ermilov1-1/+1
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-03-16$time_iso8601 log variableIgor Sysoev1-1/+15
patch by Michael Lustfield
2010-05-31fix building by ICC8, the bug had been introduced in r3476Igor Sysoev1-2/+0
2010-03-25*) introduce ngx_time_sigsafe_update() to update the error log time onlyIgor Sysoev1-16/+63
*) change ngx_time_update() interface
2010-03-13*) use previously cached GMT offset value to update time from a signal handlerIgor Sysoev1-12/+31
*) change ngx_time_update() interface since there are no notification methods those return time
2008-08-30ngx_timezone_update()Igor Sysoev1-4/+0
2008-08-11ngx_next_time()Igor Sysoev1-0/+39
2008-04-13use more straightforward ngx_gmtime() implementationIgor Sysoev1-37/+48
2008-01-31treat time_t as unsigned timeIgor Sysoev1-7/+10
2007-11-1564-bit time_t compatibilityIgor Sysoev1-4/+4
2007-01-29fix segfault if nginx was build with -O2 -fomit-frame-pointer,Igor Sysoev1-1/+1
r1082 did not fix the bug the bug lived for a long time but became apparent when nginx was built with gcc 4.0.x -O2 optimization
2007-01-25fix segfault if nginx was build with -O2 -fomit-frame-pointerIgor Sysoev1-3/+3
(at least by gcc 4.0.2 and 4.0.3)
2006-12-19the initial slot is out of arrayIgor Sysoev1-1/+1
2006-12-06slot number must be incremented once per second only,Igor Sysoev1-8/+10
ngx_time_update() set msec in an wrong slot
2005-10-19nginx-0.3.3-RELEASE importrelease-0.3.3Igor Sysoev1-124/+67
*) 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.
2005-10-07nginx-0.3.0-RELEASE importrelease-0.3.0Igor Sysoev1-7/+3
*) Change: the 10-days live time limit of worker process was eliminated. The limit was introduced because of millisecond timers overflow.
2005-06-23nginx-0.1.37-RELEASE importrelease-0.1.37Igor Sysoev1-3/+3
*) Change: now the "\n" is added to the end of the "nginx.pid" file. *) Bugfix: the responses may be transferred not completely, if many parts or the big parts were included by SSI. *) Bugfix: if all backends had returned the 404 reponse and the "http_404" parameter of the "proxy_next_upstream" or "fastcgi_next_upstream" directives was used, then nginx started to request all backends again.
2005-05-23nginx-0.1.33-RELEASE importrelease-0.1.33Igor Sysoev1-19/+19
*) Bugfix: nginx could not be built with the --without-pcre parameter; the bug had appeared in 0.1.29. *) Bugfix: 3, 4, 7, and 8 the "proxy_set_header" directives in one level cause the bus fault on start up. *) Bugfix: the HTTP protocol was specified in the HTTPS redirects. *) Bugfix: if the "rewrite" directive used the captures inside the "if" directive, then the 500 error code was returned.
2005-05-12nginx-0.1.29-RELEASE importrelease-0.1.29Igor Sysoev1-1/+2
*) Feature: the ngx_http_ssi_module supports "include virtual" command. *) Feature: the ngx_http_ssi_module supports the condition command like 'if expr="$NAME"' and "else" and "endif" commands. Only one nested level is supported. *) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and DATE_GMT variables and "config timefmt" command. *) Feature: the "ssi_ignore_recycled_buffers" directive. *) Bugfix: the "echo" command did not show the default value for the empty QUERY_STRING variable. *) Change: the ngx_http_proxy_module was rewritten. *) Feature: the "proxy_redirect", "proxy_pass_request_headers", "proxy_pass_request_body", and "proxy_method" directives. *) Feature: the "proxy_set_header" directive. The "proxy_x_var" was canceled and must be replaced with the proxy_set_header directive. *) Change: the "proxy_preserve_host" is canceled and must be replaced with the "proxy_set_header Host $host" and the "proxy_redirect off" directives, the "proxy_set_header Host $host:$proxy_port" directive and the appropriate proxy_redirect directives. *) Change: the "proxy_set_x_real_ip" is canceled and must be replaced with the "proxy_set_header X-Real-IP $remote_addr" directive. *) Change: the "proxy_add_x_forwarded_for" is canceled and must be replaced with the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for" directive. *) Change: the "proxy_set_x_url" is canceled and must be replaced with the "proxy_set_header X-URL http://$host:$server_port$request_uri" directive. *) Feature: the "fastcgi_param" directive. *) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params" directive are canceled and must be replaced with the fastcgi_param directives. *) Feature: the "index" directive can use the variables. *) Feature: the "index" directive can be used at http and server levels. *) Change: the last index only in the "index" directive can be absolute. *) Feature: the "rewrite" directive can use the variables. *) Feature: the "internal" directive. *) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR, SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME, REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables. *) Change: nginx now passes the invalid lines in a client request headers or a backend response header. *) Bugfix: if the backend did not transfer response for a long time and the "send_timeout" was less than "proxy_read_timeout", then nginx returned the 408 response. *) Bugfix: the segmentation fault was occurred if the backend sent an invalid line in response header; the bug had appeared in 0.1.26. *) Bugfix: the segmentation fault may occurred in FastCGI fault tolerance configuration. *) Bugfix: the "expires" directive did not remove the previous "Expires" and "Cache-Control" headers. *) Bugfix: nginx did not take into account trailing dot in "Host" header line. *) Bugfix: the ngx_http_auth_module did not work under Linux. *) Bugfix: the rewrite directive worked incorrectly, if the arguments were in a request. *) Bugfix: nginx could not be built on MacOS X.
2005-03-19nginx-0.1.25-RELEASE importrelease-0.1.25Igor Sysoev1-8/+15
*) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
2005-03-04nginx-0.1.24-RELEASE importrelease-0.1.24Igor Sysoev1-1/+1
*) Feature: the ngx_http_ssi_filter_module supports the QUERY_STRING and DOCUMENT_URI variables. *) Bugfix: the ngx_http_autoindex_module may some times return the 404 response for existent directory, if this directory was used in "alias" directive. *) Bugfix: the ngx_http_ssi_filter_module ran incorrectly for large responses. *) Bugfix: the lack of the "Referer" header line was always accounted as valid referrer.
2005-02-16nginx-0.1.19-RELEASE importrelease-0.1.19Igor Sysoev1-2/+1
*) Bugfix: now, if request contains the zero, then the 404 error is returned for the local requests. *) Bugfix: nginx could not be built on NetBSD 2.0. *) Bugfix: the timeout may occur while reading of the the client request body via SSL connections.
2004-12-21nginx-0.1.13-RELEASE importrelease-0.1.13Igor Sysoev1-3/+3
*) Feature: the server_names_hash and server_names_hash_threshold directives. *) Bugfix: the *.domain.tld names in the "server_name" directive did not work. *) Bugfix: the %request_length log parameter logged the incorrect length.
2004-11-25nginx-0.1.9-RELEASE importrelease-0.1.9Igor Sysoev1-2/+2
*) Bugfix: the proxied request was sent without arguments if the request contains "//", "/./", "/../" or "%XX". *) Bugfix: the large compressed responses may be transferred not completely. *) Bugfix: the files bigger than 2G was not transferred on Linux that does not support sendfile64(). *) Bugfix: while the build configuration on Linux the --with-poll_module parameter was required; the bug had appeared in 0.1.8.
2004-11-11nginx-0.1.5-RELEASE importrelease-0.1.5Igor Sysoev1-66/+19
*) 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-10-21nginx-0.1.2-RELEASE importrelease-0.1.2Igor Sysoev1-0/+32
*) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; the bug had appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; the bug had appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
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-1/+7
2004-09-21nginx-0.0.11-2004-09-21-19:47:05 importIgor Sysoev1-2/+2
2004-08-29nginx-0.0.10-2004-08-29-07:55:41 importIgor Sysoev1-8/+45
2004-07-12nginx-0.0.7-2004-07-13-00:43:53 importIgor Sysoev1-1/+1
2004-06-27nginx-0.0.7-2004-06-27-22:01:57 importIgor Sysoev1-44/+71
2004-06-17nginx-0.0.7-2004-06-17-21:18:53 importIgor Sysoev1-3/+8
2004-04-25nginx-0.0.3-2004-04-26-00:13:21 importIgor Sysoev1-1/+1
2004-04-21nginx-0.0.3-2004-04-22-00:13:48 importIgor Sysoev1-30/+9
2004-04-21nginx-0.0.3-2004-04-21-22:54:33 importIgor Sysoev1-43/+114
2004-03-29nginx-0.0.3-2004-03-29-21:43:58 importIgor Sysoev1-7/+16
2004-03-16nginx-0.0.2-2004-03-16-10:10:12 importIgor Sysoev1-16/+18
2004-02-26nginx-0.0.2-2004-02-26-20:10:01 importIgor Sysoev1-7/+3
2004-02-25nginx-0.0.2-2004-02-25-23:16:15 importIgor Sysoev1-9/+20