[Phpfreechat-svn] SF.net SVN: phpfreechat: [911] trunk/src
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-12-29 12:23:06
|
Revision: 911 http://svn.sourceforge.net/phpfreechat/?rev=911&view=rev Author: kerphi Date: 2006-12-29 04:22:57 -0800 (Fri, 29 Dec 2006) Log Message: ----------- [en] Bandwidth optimization: do not return any bytes when the periodic /update command returns nothing. [0h30] [fr] Optimisation de la bande passante : retourne rien du tout lorsque la commande periodique /update ne retourne rien. [0h30] Modified Paths: -------------- trunk/src/commands/update.class.php trunk/src/phpfreechat.class.php Modified: trunk/src/commands/update.class.php =================================================================== --- trunk/src/commands/update.class.php 2006-12-29 11:57:52 UTC (rev 910) +++ trunk/src/commands/update.class.php 2006-12-29 12:22:57 UTC (rev 911) @@ -69,7 +69,8 @@ $cmd->run($xml_reponse, $cmdp); } - $xml_reponse->script("pfc.handleResponse('update', 'ok', '');"); + // do not send ok response to save bandwidth + // $xml_reponse->script("pfc.handleResponse('update', 'ok', '');"); } else $xml_reponse->script("pfc.handleResponse('update', 'ko', '');"); Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-12-29 11:57:52 UTC (rev 910) +++ trunk/src/phpfreechat.class.php 2006-12-29 12:22:57 UTC (rev 911) @@ -61,11 +61,11 @@ { require_once $c->xajaxpath."/xajax_core/xajax.inc.php"; $this->xajax = new xajax($c->server_script_url.(isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "" ? "?".$_SERVER["QUERY_STRING"] : ""), 'pfc_'); - if ($c->debugxajax) $this->xajax->debugOn(); + if ($c->debugxajax) $this->xajax->setFlag('debug', true); $this->xajax->setWrapperPrefix('pfc_'); - // $this->xajax->waitCursorOff(); // do not show a wait cursor during chat updates - //$this->xajax->cleanBufferOff(); - //$this->xajax->errorHandlerOn(); // used to have verbose error logs + $this->xajax->setFlag('waitCursor', false); + $this->xajax->setFlag('cleanBuffer', false); + $this->xajax->setFlag('errorHandler', true); $this->xajax->registerFunction(array('handleRequest',&$this,'handleRequest')); $this->xajax->registerFunction(array('loadStyles',&$this,'loadStyles')); $this->xajax->registerFunction(array('loadScripts',&$this,'loadScripts')); @@ -386,8 +386,8 @@ ob_end_clean(); } - // do nothing else if the xml response is empty - //if ($xml_reponse->xml == "") die(); + // do nothing else if the xml response is empty in order to save bandwidth + if ($xml_reponse->getCommandCount() == 0) die(); return $xml_reponse; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |