Skip to content

Commit 58b6e92

Browse files
authored
Add files via upload
Increase the history record
1 parent 301af4e commit 58b6e92

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ngx_http_dynamic_limit_req_module.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ static ngx_int_t ngx_http_limit_req_handler(ngx_http_request_t *r) {
219219
if (reply->str == NULL) {
220220
reply = redisCommand(c, "SETEX %s %s %s", Host, block_second,
221221
Host);
222+
/* Increase the history record */
223+
reply = redisCommand(c,"SELECT 1");
224+
reply = redisCommand(c, "SET %s %s", Host, Host);
225+
reply = redisCommand(c,"SELECT 0");
226+
/* Increase the history record */
222227
}
223228
}
224229
if (rc != NGX_AGAIN) {
@@ -245,7 +250,7 @@ static ngx_int_t ngx_http_limit_req_handler(ngx_http_request_t *r) {
245250

246251
ngx_log_error(lrcf->limit_log_level, r->connection->log, 0,
247252
"limiting requests, excess: %ui.%03ui by zone \"%V\" "
248-
"ip=%s ip2=%V num1=%d ,num2=%d",
253+
"ip=%s ip2=%V num1=%d num2=%d",
249254
excess / 1000, excess % 1000, &limit->shm_zone->shm.name, Host,
250255
&r->connection->addr_text, strlen((char * )Host),
251256
r->connection->addr_text.len);

0 commit comments

Comments
 (0)