Changeset 5403 in subversion


Ignore:
Timestamp:
Nov 9, 2011 8:40:23 AM (19 months ago)
Author:
thomasb
Message:

Consider replication delays in session storage

Location:
trunk/roundcubemail/program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_session.php

    r5247 r5403  
    391391    $this->destroy(session_id()); 
    392392    rcmail::setcookie($this->cookiename, '-del-', time() - 60); 
     393  } 
     394 
     395 
     396  /** 
     397   * Re-read session data from storage backend 
     398   */ 
     399  public function reload() 
     400  { 
     401    if ($this->key && $this->memcache) 
     402      $this->mc_read($this->key); 
     403    else if ($this->key) 
     404      $this->db_read($this->key); 
    393405  } 
    394406 
  • trunk/roundcubemail/program/steps/mail/compose.inc

    r5401 r5403  
    3131$COMPOSE_ID = get_input_value('_id', RCUBE_INPUT_GET); 
    3232$_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; 
     33 
     34// give replicated session storage some time to synchronize 
     35$retries = 0; 
     36while ($COMPOSE_ID && !is_array($_SESSION['compose']) && $RCMAIL->db->is_replicated() && $retries++ < 5) { 
     37  usleep(500000); 
     38  $RCMAIL->session->reload(); 
     39  $_SESSION['compose'] = $_SESSION['compose_data_'.$COMPOSE_ID]; 
     40} 
    3341 
    3442// Nothing below is called during message composition, only at "new/forward/reply/draft" initialization or 
Note: See TracChangeset for help on using the changeset viewer.