- /* custom headers */
- headers = GET_STATIC_PROP(headers);
- if (Z_TYPE_P(headers) == IS_ARRAY) {
- char *name = NULL;
- ulong idx = 0;
- zval **value;
-
- FOREACH_KEYVAL(headers, name, idx, value) {
- if (name) {
- if (Z_TYPE_PP(value) == IS_ARRAY) {
- zend_bool first = 1;
- zval **data;
-
- FOREACH_VAL(*value, data) {
- convert_to_string_ex(data);
- http_send_header_ex(name, strlen(name), Z_STRVAL_PP(data), Z_STRLEN_PP(data), first, NULL);
- first = 0;
- }
- } else {
- convert_to_string_ex(value);
- http_send_header_ex(name, strlen(name), Z_STRVAL_PP(value), Z_STRLEN_PP(value), 1, NULL);
- }
- name = NULL;
- }
- }
- }
-
- /* gzip */
- if (zval_is_true(GET_STATIC_PROP(gzip))) {
- php_start_ob_buffer_named("ob_gzhandler", 0, 0 TSRMLS_CC);
- } else {
- php_start_ob_buffer(NULL, 0, 0 TSRMLS_CC);
- }
-