Commit 2c6fe24
committed
MINOR: ssl_sock: avoid iterating realloc(+1) on stored context
The SSL context storage in servers is per-thread, and the contents are
allocated for a length that is determined from the session. It turns out
that placing some traces there revealed that the realloc() that is called
to grow the area can be called multiple times in a row even for just
health checks, to grow the area by just one or two bytes. Given that
malloc() allocates in multiples of 8 or 16 anyway, let's round the
allocated size up to the nearest multiple of 8 to avoid this unneeded
operation.1 parent 2cc53ec commit 2c6fe24
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4279 | 4279 | | |
4280 | 4280 | | |
4281 | 4281 | | |
| 4282 | + | |
4282 | 4283 | | |
4283 | 4284 | | |
4284 | 4285 | | |
| |||
0 commit comments