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