25
1
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:
Alexey Shchepin 2012-02-20 17:41:56 +02:00 committed by Paweł Chmielowski
parent 1f1a98d7ae
commit 4637e2c66b

View File

@ -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)