mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Avoid quadratic behavior in reading SSL data
This commit is contained in:
parent
1f1a98d7ae
commit
4637e2c66b
@ -442,9 +442,11 @@ static ErlDrvSSizeT tls_drv_control(ErlDrvData handle,
|
||||
{
|
||||
//printf("%d bytes of decrypted data read from state machine\r\n",res);
|
||||
rlen += res;
|
||||
size += BUF_SIZE;
|
||||
if (size - rlen < BUF_SIZE) {
|
||||
size *= 2;
|
||||
b = driver_realloc_binary(b, size);
|
||||
}
|
||||
}
|
||||
|
||||
if (res < 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user