mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-20 16:15:59 +01:00
Avoid quadratic behavior in reading SSL data
This commit is contained in:
parent
1f1a98d7ae
commit
4637e2c66b
@ -442,8 +442,10 @@ 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;
|
||||
b = driver_realloc_binary(b, 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