]> git.kaiwu.me - nginx.git/commitdiff
Limit req: don't truncate key value to 255 bytes.
authorValentin Bartenev <vbart@nginx.com>
Tue, 16 Sep 2014 17:12:51 +0000 (21:12 +0400)
committerValentin Bartenev <vbart@nginx.com>
Tue, 16 Sep 2014 17:12:51 +0000 (21:12 +0400)
While the module allows to use values up to 65535 bytes as a key,
that actually never worked properly.

src/http/modules/ngx_http_limit_req_module.c

index 74f7fdaa75fd5697a427cd4a82f8dacf92c0069e..27d7b3092ec46c63639cf3c3c2a03f0f21468e27 100644 (file)
@@ -461,7 +461,7 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
 
     lr = (ngx_http_limit_req_node_t *) &node->color;
 
-    lr->len = (u_char) len;
+    lr->len = (u_short) len;
     lr->excess = 0;
 
     ngx_memcpy(lr->data, data, len);