comparison src/core/ngx_times.c @ 380:3ce4580ae286 NGINX_0_6_34

nginx 0.6.34 *) Change: now the EAGAIN error returned by connect() is not considered as temporary error. *) Change: now the "gzip_vary" directive turned on issues a "Vary: Accept-Encoding" header line for uncompressed responses too. *) Feature: the "expires" directive supports daily time. *) Feature: the "Expect" request header line support. *) Feature: now the "rewrite" directive does a redirect automatically if the "https://" protocol is used. *) Bugfix: the "listen" directive parameters such as "backlog", "rcvbuf", etc. were not set, if a default server was not the first one. *) Bugfix: the "log_not_found" directive did not work for index files tests. *) Bugfix: now if FastCGI server sends a "Location" header line without status line, then nginx uses 302 status code. Thanks to Maxim Dounin. *) Bugfix: the ngx_http_flv_module did not support several values in a query string. *) Bugfix: when a request to a directory was redirected with the slash added, nginx dropped a query string from the original request.
author Igor Sysoev <http://sysoev.ru>
date Thu, 27 Nov 2008 00:00:00 +0300
parents 6639b93e81b2
children
comparison
equal deleted inserted replaced
379:522189e0ef36 380:3ce4580ae286
289 tp->ngx_tm_mday = (ngx_tm_mday_t) mday; 289 tp->ngx_tm_mday = (ngx_tm_mday_t) mday;
290 tp->ngx_tm_mon = (ngx_tm_mon_t) mon; 290 tp->ngx_tm_mon = (ngx_tm_mon_t) mon;
291 tp->ngx_tm_year = (ngx_tm_year_t) year; 291 tp->ngx_tm_year = (ngx_tm_year_t) year;
292 tp->ngx_tm_wday = (ngx_tm_wday_t) wday; 292 tp->ngx_tm_wday = (ngx_tm_wday_t) wday;
293 } 293 }
294
295
296 time_t
297 ngx_next_time(time_t when)
298 {
299 time_t now, next;
300 struct tm tm;
301
302 now = ngx_time();
303
304 ngx_libc_localtime(now, &tm);
305
306 tm.tm_hour = (int) (when / 3600);
307 when %= 3600;
308 tm.tm_min = (int) (when / 60);
309 tm.tm_sec = (int) (when % 60);
310
311 next = mktime(&tm);
312
313 if (next == -1) {
314 return -1;
315 }
316
317 if (next - now > 0) {
318 return next;
319 }
320
321 tm.tm_mday++;
322
323 /* mktime() should normalize a date (Jan 32, etc) */
324
325 next = mktime(&tm);
326
327 if (next != -1) {
328 return next;
329 }
330
331 return -1;
332 }