# HG changeset patch # User Dan # Date 1230081635 18000 # Node ID ee64bb096f56b1c0908af272064890ce4623a188 # Parent af239423ed158f9a056c30be70eee459a6f8014d A few miscellaneous fixes including modifying WebServer to write data in chunks (improved performance and reliability on a slow connection) diff -r af239423ed15 -r ee64bb096f56 functions.php --- a/functions.php Tue Dec 23 17:37:51 2008 -0500 +++ b/functions.php Tue Dec 23 20:20:35 2008 -0500 @@ -290,9 +290,13 @@ // separate from the default) if ( @is_dir(GREY_ROOT . '/.hg') ) + { require(GREY_ROOT . '/config.dev.php'); + } else + { require(GREY_ROOT . '/config.php'); + } } foreach ( array('public', 'enable_ipv4', 'enable_ipv6', 'allowcontrol', 'theme', 'allow_fork', 'use_auth', 'auth_data', 'configpass') as $var ) diff -r af239423ed15 -r ee64bb096f56 greyhound.php --- a/greyhound.php Tue Dec 23 17:37:51 2008 -0500 +++ b/greyhound.php Tue Dec 23 20:20:35 2008 -0500 @@ -34,7 +34,7 @@ define('GREY_ROOT', dirname(__FILE__)); // what kind of terminal do we have? -$use_colors = ( @in_array(@$_SERVER['TERM'], array('linux', 'xterm', 'vt100')) ) ? true : false; +$use_colors = ( @in_array(@$_SERVER['TERM'], array('linux', 'xterm', 'vt100', 'screen')) ) ? true : false; require(GREY_ROOT . '/functions.php'); // start up... diff -r af239423ed15 -r ee64bb096f56 uiconfig.php --- a/uiconfig.php Tue Dec 23 17:37:51 2008 -0500 +++ b/uiconfig.php Tue Dec 23 20:20:35 2008 -0500 @@ -85,7 +85,7 @@ } $auth_data = var_export_string($auth_data); - $new_configpass = ( is_string($_POST['newconfigpass']) && $_POST['newconfigpass'] != '____________________' ) ? sha1($_POST['newconfigpass']) : $GLOBALS['configpass']; + $new_configpass = ( isset($_POST['configpass']) && is_string($_POST['newconfigpass']) && $_POST['newconfigpass'] != '____________________' ) ? sha1($_POST['newconfigpass']) : $GLOBALS['configpass']; $config_file = <<server_string; + } unset($client_headers[0]); foreach ( $client_headers as $line ) { @@ -2126,7 +2130,15 @@ function write($data) { - return @fwrite($this->sock, $data); + $data = str_split($data, 8096); + foreach ( $data as $chunk ) + { + while ( !@fwrite($this->sock, $chunk) ) + { + usleep(50000); + } + } + return true; } function is_eof()