~ubuntu-branches/ubuntu/saucy/nginx/saucy-updates

« back to all changes in this revision

Viewing changes to debian/modules/nginx-echo/src/ngx_http_echo_sleep.c

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Cyril Lavier, Michael Lustfield, Kartik Mistry
  • Date: 2012-05-14 11:15:00 UTC
  • mfrom: (4.2.49 sid)
  • Revision ID: package-import@ubuntu.com-20120514111500-1y9ij7zulu9xnmry
Tags: 1.2.0-1
[Cyril Lavier]
* New upstream release. (Closes: #670306)
  + 1.2.x is stable release now.
* debian/modules/chunkin-nginx-module:
  + Updated chunkin-nginx-module to v0.23rc2-3-g85eca98.
* debian/modules/headers-more-module:
  + Updated headers-more-module to v0.17rc1-4-g33a82ed.
* debian/modules/nginx-development-kit:
  + Updated nginx-development-kit to v0.2.17-7-g24202b4.
* debian/modules/nginx-echo:
  + Updated nginx-echo to v0.38rc2-7-g080c0a1.
* debian/modules/nginx-lua:
  + Updated nginx-lua to v0.5.0rc25-5-g8d28785.
* debian/modules/nginx-upstream-fair:
  + Updated nginx-upstream-fair to a18b409.
* debian/modules/nginx-upload-progress:
  + Updated nginx-upload-progress to v0.9.0-0-ga788dea.
* debian/modules/naxsi:
  + Updated naxsi to 0.46
* debian/modules/README.Modules-versions:
  + Updated versions and URLs for modules.
* debian/naxsi-ui-extract, debian/naxsi-ui-intercept,
  debian/nginx-naxsi-ui.*, debian/naxsi-ui-extract.1,
  debian/naxsi-ui-intercept.1, debian/rules:
  + Added nginx-naxsi-ui package containing the learning daemon
    and the WebUI.
* debian/nginx-common.nginx.default, debian/nginx-common.nginx.init:
  + Renamed files to be compliant with the nginx-naxsi-ui package.
* debian/po:
  + Added needed files for using po-debconf.
  + Added French translation.
* debian/control:
  + Applied the modifications given after the review by Justin Rye.

[Michael Lustfield]
* debian/conf/uwsgi_params:
  + Added UWSGI_SCHEME to uwsgi_params. (Closes: #664878)
* debian/conf/sites-available/default:
  + Added allow directive for ipv6 localhost. (Closes: #664271)

[Kartik Mistry]
* debian/control:
  + wrap-and-sort.
* debian/copyright:
  + Added missing copyrights, minor formatting fixes.
* debian/nginx-common.nginx.init:
  + Added ulimit for restarts, Thanks to Daniel Roschka
    <danielroschka@phoenitydawn.de> for patch. (Closes: #673580)
* debian/conf/sites-available/default:
  + Added patch to fix deprecated "listen" directive, Thanks to
    Guillaume Plessis <gui@dotdeb.org> for patch. (Closes: #672632)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (C) agentzh */
2
2
 
 
3
#ifndef DDEBUG
3
4
#define DDEBUG 0
 
5
#endif
4
6
#include "ddebug.h"
5
7
 
6
8
#include "ngx_http_echo_sleep.h"
23
25
{
24
26
    ngx_str_t                   *computed_arg;
25
27
    ngx_str_t                   *computed_arg_elts;
26
 
    float                        delay; /* in sec */
 
28
    ngx_int_t                    delay; /* in msec */
27
29
    ngx_http_cleanup_t          *cln;
28
30
 
29
31
    computed_arg_elts = computed_args->elts;
30
32
    computed_arg = &computed_arg_elts[0];
31
33
 
32
 
    delay = atof( (char*) computed_arg->data );
 
34
    delay = ngx_atofp(computed_arg->data, computed_arg->len, 3);
33
35
 
34
 
    if (delay < 0.001) { /* should be bigger than 1 msec */
 
36
    if (delay == NGX_ERROR) {
35
37
        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
36
38
                   "invalid sleep duration \"%V\"", &computed_arg_elts[0]);
37
39
 
38
40
        return NGX_HTTP_BAD_REQUEST;
39
41
    }
40
42
 
41
 
    dd("adding timer with delay %.02lf sec, r:%.*s", delay,
42
 
            (int) r->uri.len,
43
 
            r->uri.data);
 
43
    dd("adding timer with delay %lu ms, r:%.*s", (unsigned long) delay,
 
44
            (int) r->uri.len, r->uri.data);
44
45
 
45
 
    ngx_add_timer(&ctx->sleep, (ngx_msec_t) (1000 * delay));
 
46
    ngx_add_timer(&ctx->sleep, (ngx_msec_t) delay);
46
47
 
47
48
    /* we don't check broken downstream connections
48
49
     * ourselves so even if the client shuts down
158
159
{
159
160
    ngx_str_t                   *computed_arg;
160
161
    ngx_str_t                   *computed_arg_elts;
161
 
    float                       delay; /* in sec */
 
162
    ngx_int_t                    delay; /* in msec */
162
163
 
163
164
    computed_arg_elts = computed_args->elts;
164
165
    computed_arg = &computed_arg_elts[0];
165
166
 
166
 
    delay = atof( (char*) computed_arg->data );
 
167
    delay = ngx_atofp(computed_arg->data, computed_arg->len, 3);
167
168
 
168
 
    if (delay < 0.001) { /* should be bigger than 1 msec */
 
169
    if (delay == NGX_ERROR) {
169
170
        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
170
171
                   "invalid sleep duration \"%V\"", &computed_arg_elts[0]);
171
172
        return NGX_HTTP_BAD_REQUEST;
172
173
    }
173
174
 
174
 
    dd("blocking DELAY = %.02lf sec", delay);
 
175
    dd("blocking delay: %lu ms", (unsigned long) delay);
175
176
 
176
 
    ngx_msleep((ngx_msec_t) (1000 * delay));
 
177
    ngx_msleep((ngx_msec_t) delay);
177
178
 
178
179
    return NGX_OK;
179
180
}