thomascube
2011-11-09 ad71ba4fcd52a444452209460e19f63fefc59839
Backporting r5403 to release branch

2 files modified
20 ■■■■■ changed files
program/include/rcube_session.php 12 ●●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 8 ●●●●● patch | view | raw | blame | history
program/include/rcube_session.php
@@ -394,6 +394,18 @@
  /**
   * Re-read session data from storage backend
   */
  public function reload()
  {
    if ($this->key && $this->memcache)
      $this->mc_read($this->key);
    else if ($this->key)
      $this->db_read($this->key);
  }
  /**
   * Serialize session data
   */
  private function serialize($vars)
program/steps/mail/compose.inc
@@ -31,6 +31,14 @@
$COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET);
$_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID];
// give replicated session storage some time to synchronize
$retries = 0;
while ($COMPOSE_ID && !is_array($_SESSION['compose']) && $RCMAIL->db->is_replicated() && $retries++ < 5) {
  usleep(500000);
  $RCMAIL->session->reload();
  $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID];
}
// Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or
// if a compose-ID is given (i.e. when the compose step is opened in a new window/tab).
if (!is_array($_SESSION['compose']))