[Phpfreechat-svn] SF.net SVN: phpfreechat: [833] trunk/src/client/pfcclient.js
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-16 18:00:49
|
Revision: 833 http://svn.sourceforge.net/phpfreechat/?rev=833&view=rev Author: kerphi Date: 2006-10-16 11:00:41 -0700 (Mon, 16 Oct 2006) Log Message: ----------- [en] Optimize the /update command : a new update command is not sent since the last response is not received. [30min] [fr] Optimisation de la commande /update : une nouvelle command /update n'est pas envoy?\195?\169 tant que la r?\195?\169ponse du pr?\195?\169cedent n'est pas re?\195?\167u. [30min] Modified Paths: -------------- trunk/src/client/pfcclient.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-10-16 17:31:18 UTC (rev 832) +++ trunk/src/client/pfcclient.js 2006-10-16 18:00:41 UTC (rev 833) @@ -311,6 +311,7 @@ { if (resp == "ok") { + this.canupdatenexttime = true; } } else if (cmd == "version") @@ -845,7 +846,12 @@ clearTimeout(this.timeout); if (start) { - var res = this.sendRequest('/update'); + var res = true; + if (this.canupdatenexttime) + { + res = this.sendRequest('/update'); + this.canupdatenexttime = false; // don't update since the 'ok' response is received + } // adjust the refresh_delay if the connection was lost if (res == false) { this.refresh_delay = this.refresh_delay * 2; } // setup the next update This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |