comparison src/http/modules/ngx_http_limit_req_module.c @ 506:e8b686f230a8 NGINX_0_8_5

nginx 0.8.5 *) Bugfix: now nginx allows underscores in a request method. *) Bugfix: a 500 error code was returned for invalid login/password while HTTP Basic authentication on Windows. *) Bugfix: ngx_http_perl_module responses did not work in subrequests. *) Bugfix: in ngx_http_limit_req_module. Thanks to Maxim Dounin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 13 Jul 2009 00:00:00 +0400
parents f39b9e29530d
children f7ec98e3caeb
comparison
equal deleted inserted replaced
505:1191e3250e60 506:e8b686f230a8
179 } else { 179 } else {
180 excess = 0; 180 excess = 0;
181 } 181 }
182 182
183 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 183 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
184 "limit_req: %i %ui.%03ui", rc, excess / 1000, excess % 1000); 184 "limit_req: %i %ui.%03ui", rc, excess / 1000, excess % 1000);
185 185
186 if (rc == NGX_BUSY) { 186 if (rc == NGX_BUSY) {
187 ngx_shmtx_unlock(&ctx->shpool->mutex); 187 ngx_shmtx_unlock(&ctx->shpool->mutex);
188 188
189 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 189 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
261 261
262 262
263 static void 263 static void
264 ngx_http_limit_req_delay(ngx_http_request_t *r) 264 ngx_http_limit_req_delay(ngx_http_request_t *r)
265 { 265 {
266 ngx_event_t *wev;
267
266 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 268 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
267 "limit_req delay"); 269 "limit_req delay");
270
271 wev = r->connection->write;
272
273 if (!wev->timedout) {
274
275 if (ngx_handle_write_event(wev, 0) != NGX_OK) {
276 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
277 }
278
279 return;
280 }
281
282 wev->timedout = 0;
268 283
269 if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) { 284 if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
270 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); 285 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
271 return; 286 return;
272 } 287 }