mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-19 01:54:37 +00:00
BUG/MINOR: shctx: do not look for available blocks when the first one is enough
In shctx_row_reserve_hot() we only leave if we've found the exact requested size instead of at least as large, as is documented. This results in extra lookups and free calls in the avail loop while it is not needed, and participates to seeing a negative data_len early as spotted in previous bugs. It doesn't seem to have any other impact however, but it's better to backport it to stable branches.
This commit is contained in:
parent
b15e8a1c96
commit
cafe15c743
@ -61,7 +61,7 @@ struct shared_block *shctx_row_reserve_hot(struct shared_context *shctx,
|
||||
return last ? last : first;
|
||||
} else {
|
||||
data_len -= remain;
|
||||
if (!data_len)
|
||||
if (data_len <= 0)
|
||||
return last ? last : first;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user