Push problems due to odd KeepAlive behaviour

Clarify issues about the installation

Re: Push problems due to odd KeepAlive behaviour

Postby mschering » Sun Sep 12, 2010 12:56 pm

If anyone is interested here's my code. I added these functions to the backend:
Code: Select all
function __construct(){
      //parent::__construct();

      global $devid;


      $this->lockFile = BASE_PATH.STATE_DIR.$devid.'.lock';
      $this->lockId=uniqid(time());
   }

   function Locked (){
      $locked = file_exists($this->lockFile) && filemtime($this->lockFile)>time()-30 && file_get_contents($this->lockFile)!=$this->lockId;
      if(!$locked)
         debugLog('Device is NOT locked');
      else
         debugLog('Device is locked');
      return $locked;
   }

   function Unlock(){
      if(file_exists($this->lockFile)){
         debugLog('Unlocked device '.$GLOBALS['devid']);
         unlink($this->lockFile);
      }
   }

   function Lock(){
      debugLog('Locked device '.$GLOBALS['devid']);
      file_put_contents($this->lockFile, $this->lockId);
   }


In the AlterPingChanges function I call $this->Lock();

In the GetMessageList function I call $this->Unlock();

And now the sad part is that I had to change the core code of z-push in request.php in the HandlePing function I added on line 976:
Code: Select all
//check if another Ping process is already running
if($backend->Locked()){
   $pingstatus=4;
   break;
}


right after:
Code: Select all
for($n=0;$n<$lifetime / $timeout; $n++ ) {
        //check the remote wipe status
        if (PROVISIONING === true) {
           $rwstatus = $backend->getDeviceRWStatus($user, $auth_pw, $devid);
           if ($rwstatus == SYNC_PROVISION_RWSTATUS_PENDING || $rwstatus == SYNC_PROVISION_RWSTATUS_WIPED) {
               //return 7 because it forces folder sync
               $pingstatus = 7;
               break;
           }
        }



I hope this helps solving the issue!
mschering
 
Posts: 27
Joined: Sun Sep 13, 2009 1:08 pm

Re: Push problems due to odd KeepAlive behaviour

Postby steffan » Sun Sep 12, 2010 11:37 pm

Rather than piecemeal this together, if you want to post an archive online, I'm happy to test it for you. I too would like to find a solution.
steffan
 
Posts: 7
Joined: Tue Aug 03, 2010 4:38 am

Re: Push problems due to odd KeepAlive behaviour

Postby mschering » Mon Sep 13, 2010 1:48 pm

The absence of the developers on this important topic is really disappointing...
mschering
 
Posts: 27
Joined: Sun Sep 13, 2009 1:08 pm

Re: Push problems due to odd KeepAlive behaviour

Postby mku » Wed Sep 15, 2010 9:54 pm

Hi there,

I am sorry for not answering earlier but we are busy in another project and do not have enough resources to trace back this problem. I am using the ics backend which is installed a couple of thousands times and some have several hundred concurrent connections and have never encountered such a problem nor have heard anything like that from other users/admins. Is it possibly related to the IMAP implementation in PHP?

mschering wrote:The absence of the developers on this important topic is really disappointing...


You've sent an email to Z-Push development list with some outputs which clearly show that you are using some groupware product with ActiveSync support. I've downloaded the OpenSource Version of it from Sourceforge to test it but haven't found any reference to Z-Push in the archive. There are some references to Z-Push in the wiki but there wasn't Z-Push module in the community version. If Z-Push is available in commercial version of the product only, you could get professional support from Zarafa.

Sending private messages or emails will not increase the response time. We are busy, so please be patient, we read every message and will get back to you.

Greets, Manfred
Try using forum search as well!
Please do not PN me asking for support. Use the forum instead. Thank you.
mku
Site Admin
 
Posts: 1239
Joined: Thu Sep 20, 2007 4:48 pm
Location: Belo Horizonte / Brazil

Previous

Return to Installation

Who is online

Users browsing this forum: No registered users and 0 guests

cron