Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor: removed unnecessary code from the sleep handler for ngx.sle…

…ep().
  • Loading branch information...
commit 3b5dc53b86f22b8decbd1073330443d396e019c4 1 parent 07b9b3b
@agentzh agentzh authored
View
13 src/ngx_http_lua_sleep.c
@@ -109,21 +109,8 @@ ngx_http_lua_sleep_handler(ngx_event_t *ev)
log_ctx->current_request = r;
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "lua sleep handler: \"%V?%V\"", &r->uri, &r->args);
-
- if (!coctx->sleep.timedout) {
- dd("reach lua sleep event handler without timeout!");
- return;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"lua sleep timer expired: \"%V?%V\"", &r->uri, &r->args);
- if (coctx->sleep.timer_set) {
- dd("deleting timer for lua_sleep");
- ngx_del_timer(&coctx->sleep);
- }
-
ctx->cur_co_ctx = coctx;
if (ctx->entered_content_phase) {
View
7 t/023-rewrite/sleep.t
@@ -10,7 +10,7 @@ log_level('debug');
repeat_each(2);
-plan tests => repeat_each() * 38;
+plan tests => repeat_each() * 33;
#no_diff();
#no_long_string();
@@ -36,7 +36,6 @@ GET /test
^0\.(?:4[5-9]\d*|5[0-9]\d*|5)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
@@ -84,7 +83,6 @@ GET /test
^0\.(?:4[5-9]\d*|5[0-9]\d*|5)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/sleep?"
lua sleep timer expired: "/sleep?"
--- no_error_log
[error]
@@ -131,7 +129,6 @@ GET /test
^0\.(?:8[5-9]\d*|9[0-9]\d*|9)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
@@ -160,7 +157,6 @@ GET /test
blah
--- error_log
lua ready to sleep
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
@@ -191,7 +187,6 @@ blah
hiya
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
View
7 t/024-access/sleep.t
@@ -10,7 +10,7 @@ log_level('debug');
repeat_each(2);
-plan tests => repeat_each() * 38;
+plan tests => repeat_each() * 33;
#no_diff();
#no_long_string();
@@ -36,7 +36,6 @@ GET /test
^0\.(?:4[5-9]\d*|5[0-5]\d*|5)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
@@ -84,7 +83,6 @@ GET /test
^0\.(?:4[5-9]\d*|5[0-9]\d*|5)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/sleep?"
lua sleep timer expired: "/sleep?"
--- no_error_log
[error]
@@ -131,7 +129,6 @@ GET /test
^0\.(?:8[5-9]\d*|9[0-9]\d*|9)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
@@ -160,7 +157,6 @@ GET /test
blah
--- error_log
lua ready to sleep
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
@@ -191,7 +187,6 @@ blah
hiya
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
View
8 t/077-sleep.t
@@ -10,7 +10,7 @@ log_level('debug');
repeat_each(2);
-plan tests => repeat_each() * 38;
+plan tests => repeat_each() * 34;
#no_diff();
#no_long_string();
@@ -35,7 +35,7 @@ GET /test
^0\.(?:4[5-9]\d*|5[0-5]\d*|5)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
+lua sleep timer expired: "/test?"
lua sleep timer expired: "/test?"
@@ -81,7 +81,6 @@ GET /test
^0\.(?:4[5-9]\d*|5[0-9]\d*|5)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/sleep?"
lua sleep timer expired: "/sleep?"
--- no_error_log
[error]
@@ -124,7 +123,6 @@ GET /test
^(?:0\.9\d*|1\.[0-2]\d*|1)$
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
@@ -152,7 +150,6 @@ GET /test
blah
--- error_log
lua ready to sleep
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
@@ -182,7 +179,6 @@ blah
hiya
--- error_log
lua ready to sleep for
-lua sleep handler: "/test?"
lua sleep timer expired: "/test?"
--- no_error_log
[error]
Please sign in to comment.
Something went wrong with that request. Please try again.