aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/perl/ngx_http_perl_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-12-12 20:59:24 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-12-12 20:59:24 +0000
commite773324c3013cd9c0336db2f346f760d6c3a95cb (patch)
treedf2f5e4ff22abda424870184103f0e8e74588d6e /src/http/modules/perl/ngx_http_perl_module.c
parent332efbc4122d5028b6e61b15c155d477a29c8622 (diff)
downloadnginx-e773324c3013cd9c0336db2f346f760d6c3a95cb.tar.gz
nginx-e773324c3013cd9c0336db2f346f760d6c3a95cb.zip
$r->sleep()
Diffstat (limited to 'src/http/modules/perl/ngx_http_perl_module.c')
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index 1910a1bc9..94ff54f80 100644
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -41,6 +41,7 @@ static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r,
ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params);
#endif
+static void ngx_http_perl_sleep_handler(ngx_http_request_t *r);
static char *ngx_http_perl_init_interpreter(ngx_conf_t *cf,
ngx_http_perl_main_conf_t *pmcf);
static PerlInterpreter *
@@ -245,6 +246,12 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
ctx->filename.data = NULL;
ctx->redirect_uri.len = 0;
+ if (ctx->sleep) {
+ ngx_add_timer(r->connection->write, (ngx_msec_t) ctx->sleep);
+ r->write_event_handler = ngx_http_perl_sleep_handler;
+ ctx->sleep = 0;
+ }
+
if (ctx->done || ctx->next) {
return;
}
@@ -263,6 +270,16 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
}
+static void
+ngx_http_perl_sleep_handler(ngx_http_request_t *r)
+{
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "perl sleep handler");
+
+ ngx_http_perl_handle_request(r);
+}
+
+
static ngx_int_t
ngx_http_perl_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
uintptr_t data)