Klaus Demo nginx / 9e5528f
Merge of r4833: limit req: fix of rbtree node insertion. Limit req: fix of rbtree node insertion on hash collisions. The rbtree used in ngx_http_limit_req_module has two level of keys, the top is hash, and the next is the value string itself. However, when inserting a new node, only hash has been set, while the value string has been left empty. The bug was introduced in r4419 (1.1.14). Found by Charles Chen. Maxim Dounin 9 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
443443
444444 node->key = hash;
445445
446 ngx_rbtree_insert(&ctx->sh->rbtree, node);
447
448446 lr = (ngx_http_limit_req_node_t *) &node->color;
449
450 ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
451447
452448 lr->len = (u_char) len;
453449 lr->excess = 0;
454450
455451 ngx_memcpy(lr->data, data, len);
452
453 ngx_rbtree_insert(&ctx->sh->rbtree, node);
454
455 ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
456456
457457 if (account) {
458458 lr->last = now;