mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 23:55:55 +08:00
Timeout optimizations
This commit is contained in:
parent
ba645f5614
commit
d476a6a3ac
|
@ -829,17 +829,19 @@ class Utils
|
|||
*
|
||||
* @param int &$iTimer
|
||||
* @param int $iTimeToReset = 15
|
||||
* @param int $iTimeToAdd = 30
|
||||
* @param int $iTimeToAdd = 120
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function ResetTimeLimit(&$iTimer, $iTimeToReset = 15, $iTimeToAdd = 30)
|
||||
public static function ResetTimeLimit(&$iTimer, $iTimeToReset = 15, $iTimeToAdd = 120)
|
||||
{
|
||||
static $bValidateAction = null;
|
||||
if (null === $bValidateAction)
|
||||
{
|
||||
$bValidateAction = !((bool) \ini_get('safe_mode')) &&
|
||||
\MailSo\Base\Utils::FunctionExistsAndEnabled('set_time_limit');
|
||||
$sSafeMode = \strtolower(\trim(@\ini_get('safe_mode')));
|
||||
$bSafeMode = 'on' === $sSafeMode || '1' === $sSafeMode || 'true' === $sSafeMode;
|
||||
|
||||
$bValidateAction = !$bSafeMode && \MailSo\Base\Utils::FunctionExistsAndEnabled('set_time_limit');
|
||||
}
|
||||
|
||||
if ($bValidateAction)
|
||||
|
|
|
@ -26,7 +26,7 @@ class MailClient
|
|||
$this->oLogger = null;
|
||||
|
||||
$this->oImapClient = \MailSo\Imap\ImapClient::NewInstance();
|
||||
$this->oImapClient->SetTimeOuts(10, 30); // TODO
|
||||
$this->oImapClient->SetTimeOuts(10, 300); // TODO
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1927,7 +1927,7 @@ class MailClient
|
|||
{
|
||||
// TODO
|
||||
throw new \MailSo\Mail\Exceptions\RuntimeException(
|
||||
'New folder name contain delimiter');
|
||||
'New folder name contains delimiter');
|
||||
}
|
||||
|
||||
$sFullNameRawToCreate = $sFolderParentFullNameRaw.$sFullNameRawToCreate;
|
||||
|
@ -2019,8 +2019,7 @@ class MailClient
|
|||
if (0 < \strlen($sDelimiter) && false !== \strpos($sNewFolderFullNameRaw, $sDelimiter))
|
||||
{
|
||||
// TODO
|
||||
throw new \MailSo\Mail\Exceptions\RuntimeException(
|
||||
'New folder name contain delimiter');
|
||||
throw new \MailSo\Mail\Exceptions\RuntimeException('New folder name contains delimiter');
|
||||
}
|
||||
|
||||
$sFolderParentFullNameRaw = false === $iLast ? '' : \substr($sPrevFolderFullNameRaw, 0, $iLast + 1);
|
||||
|
|
|
@ -460,7 +460,10 @@ class Client {
|
|||
protected function curlRequest($url, $settings) {
|
||||
|
||||
$curl = curl_init($url);
|
||||
if (ini_get('open_basedir') === '' && ini_get('safe_mode' === 'Off'))
|
||||
$sSafeMode = strtolower(trim(@ini_get('safe_mode')));
|
||||
$bSafeMode = 'on' === $sSafeMode || '1' === $sSafeMode;
|
||||
|
||||
if (!$bSafeMode && ini_get('open_basedir') === '')
|
||||
{
|
||||
curl_setopt_array($curl, $settings);
|
||||
$data = curl_exec($curl);
|
||||
|
|
Loading…
Reference in a new issue