php_error_docref(NULL TSRMLS_CC, E_ERROR, "Dump memory failed");
}
- snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);
- sapi_add_header(cont_len, strlen(cont_len), 1);
if (soap_version == SOAP_1_2) {
sapi_add_header("Content-Type: application/soap+xml; charset=utf-8", sizeof("Content-Type: application/soap+xml; charset=utf-8")-1, 1);
} else {
old_output_conv = UG(output_encoding_conv);
UG(runtime_encoding_conv) = UG(utf8_conv);
UG(output_encoding_conv) = UG(utf8_conv);
+
+ if (zend_ini_long("zlib.output_compression", sizeof("zlib.output_compression"), 0)) {
+ sapi_add_header("Connection: close", sizeof("Connection: close")-1, 1);
+ } else {
+ snprintf(cont_len, sizeof(cont_len), "Content-Length: %d", size);
+ sapi_add_header(cont_len, strlen(cont_len), 1);
+ }
php_write(buf, size TSRMLS_CC);
+ xmlFree(buf);
+
UG(runtime_encoding_conv) = old_runtime_conv;
UG(output_encoding_conv) = old_output_conv;
- xmlFree(buf);
} else {
sapi_add_header("HTTP/1.1 202 Accepted", sizeof("HTTP/1.1 202 Accepted")-1, 1);
sapi_add_header("Content-Length: 0", sizeof("Content-Length: 0")-1, 1);