Modified: trunk/Sungrazr/Server/Adapter.php (105 => 106)
--- trunk/Sungrazr/Server/Adapter.php 2007-12-22 02:31:53 UTC (rev 105)
+++ trunk/Sungrazr/Server/Adapter.php 2007-12-22 04:40:16 UTC (rev 106)
@@ -60,6 +60,13 @@
* element of the array is the class name to pass to [[Solar::dependency]],
* and the second is the second parameter to pass to Solar::dependency.
*
+ * `send_length`
+ * : (bool) Send the content-length of the response. If the web server
+ * is performing automatic compression after the output of the PHP script,
+ * you may wish to turn this off so the connection doesn't hang due to
+ * a mismatch between the advertised size of the Content-Length and the
+ * actual size of the compressed response.
+ *
* @var array
*
*/
@@ -74,6 +81,7 @@
'class' => 'Solar_Request',
'spec' => null,
),
+ 'send_length' => true,
);
/**
@@ -350,6 +358,11 @@
$this->_headers['Content-Type'] = $content_type;
}
+ // send content length?
+ if ($this->_config['send_length']) {
+ $this->_headers['Content-Length'] = strlen($response);
+ }
+
// append to Server header
$server_class = get_class($this);
if (! empty($this->_headers['Server'])) {