Klaus Demo nginx / 1d04b14
64-bit time_t compatibility Igor Sysoev 14 years ago
7 changed file(s) with 14 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
204204 {
205205 ngx_int_t sec, min, hour, mday, mon, year, wday, yday, days;
206206
207 days = t / 86400;
207 days = (ngx_int_t) (t / 86400);
208208
209209 /* Jaunary 1, 1970 was Thursday */
210210 wday = (4 + days) % 7;
211211
212212 t %= 86400;
213 hour = t / 3600;
213 hour = (ngx_int_t) (t / 3600);
214214 t %= 3600;
215 min = t / 60;
216 sec = t % 60;
215 min = (ngx_int_t) (t / 60);
216 sec = (ngx_int_t) (t % 60);
217217
218218 /* the algorithm based on Gauss's formula */
219219
399399
400400 tp = ngx_timeofday();
401401
402 ms = (tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec);
402 ms = (ngx_msec_int_t)
403 ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
403404 ms = (ms >= 0) ? ms : 0;
404405
405406 return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000);
317317 } else {
318318 ctx->uid_set[0] = conf->service;
319319 }
320 ctx->uid_set[1] = ngx_time();
320 ctx->uid_set[1] = (uint32_t) ngx_time();
321321 ctx->uid_set[2] = ngx_pid;
322322 ctx->uid_set[3] = sequencer_v1;
323323 sequencer_v1 += 0x100;
344344 ctx->uid_set[0] = htonl(conf->service);
345345 }
346346
347 ctx->uid_set[1] = htonl(ngx_time());
347 ctx->uid_set[1] = htonl((uint32_t) ngx_time());
348348 ctx->uid_set[2] = htonl(ngx_pid);
349349 ctx->uid_set[3] = htonl(sequencer_v2);
350350 sequencer_v2 += 0x100;
23402340 return;
23412341 }
23422342
2343 timer = r->lingering_time - ngx_time();
2343 timer = (ngx_msec_t) (r->lingering_time - ngx_time());
23442344 if (timer <= 0) {
23452345 ngx_http_close_request(r, 0);
23462346 return;
492492 }
493493
494494 if (r->lingering_time) {
495 timer = r->lingering_time - ngx_time();
495 timer = (ngx_msec_t) (r->lingering_time - ngx_time());
496496
497497 if (timer <= 0) {
498498 r->discard_body = 0;
28722872
28732873 for ( ;; ) {
28742874 if (state[i].status) {
2875 ms = state[i].response_sec * 1000 + state[i].response_msec;
2875 ms = (ngx_msec_int_t)
2876 (state[i].response_sec * 1000 + state[i].response_msec);
28762877 ms = (ms >= 0) ? ms : 0;
28772878 p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000);
28782879
717717 return;
718718 }
719719
720 ngx_add_timer(s->connection->read, timer * 1000);
720 ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000));
721721
722722 s->connection->read->handler = ngx_mail_auth_sleep_handler;
723723
734734 return;
735735 }
736736
737 ngx_add_timer(s->connection->read, timer * 1000);
737 ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000));
738738
739739 s->connection->read->handler = ngx_mail_auth_sleep_handler;
740740