diff src/http/modules/perl/nginx.xs @ 911:73c66ed9a9cd

$r->sleep()
author Igor Sysoev <igor@sysoev.ru>
date Tue, 12 Dec 2006 20:59:24 +0000
parents 918e19c51a65
children 7fa926a7926d
line wrap: on
line diff
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -846,6 +846,27 @@ variable(r, name, value = NULL)
 
 
 void
+sleep(r, sleep, next)
+    CODE:
+
+    dXSTARG;
+    ngx_http_request_t   *r;
+    ngx_http_perl_ctx_t  *ctx;
+
+    ngx_http_perl_set_request(r);
+
+    ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
+
+    ctx->sleep = SvIV(ST(1));
+    ctx->next = SvRV(ST(2));
+
+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "perl sleep: %d", ctx->sleep);
+
+    XSRETURN_EMPTY;
+
+
+void
 log_error(r, err, msg)
     CODE: