- do_cache = GET_PROP(obj, cache);
-
- do_gzip = GET_PROP(obj, gzip);
-
-
-
- /* gzip */
-
- if (Z_LVAL_P(do_gzip)) {
-
- php_start_ob_buffer_named("ob_gzhandler", 0, 1 TSRMLS_CC);
-
- }
-
-
-
- /* caching */
-
- if (Z_LVAL_P(do_cache)) {
-
- zval *cctrl, *etag, *lmod, *ccraw;
-
-
-
- etag = GET_PROP(obj, eTag);
-
- lmod = GET_PROP(obj, lastModified);
-
- cctrl = GET_PROP(obj, cacheControl);
-
- ccraw = GET_PROP(obj, raw_cache_header);
-
-
-
- if (Z_LVAL_P(ccraw)) {
-
- http_cache_etag(Z_STRVAL_P(etag), Z_STRLEN_P(etag), Z_STRVAL_P(cctrl), Z_STRLEN_P(cctrl));
-
- http_cache_last_modified(Z_LVAL_P(lmod), Z_LVAL_P(lmod) ? Z_LVAL_P(lmod) : time(NULL), Z_STRVAL_P(cctrl), Z_STRLEN_P(cctrl));
-
- } else {
-
- char cc_header[42] = {0};
-
- sprintf(cc_header, "%s, must-revalidate, max-age=0", Z_STRVAL_P(cctrl));
-
- http_cache_etag(Z_STRVAL_P(etag), Z_STRLEN_P(etag), cc_header, strlen(cc_header));
-
- http_cache_last_modified(Z_LVAL_P(lmod), Z_LVAL_P(lmod) ? Z_LVAL_P(lmod) : time(NULL), cc_header, strlen(cc_header));
-
- }
-
- }
-
-
-
- /* content type */
-
- {
-
- zval *ctype = GET_PROP(obj, contentType);
-
- if (Z_STRLEN_P(ctype)) {
-
- http_send_content_type(Z_STRVAL_P(ctype), Z_STRLEN_P(ctype));
-
- } else {
-
- http_send_content_type("application/x-octetstream", sizeof("application/x-octetstream") - 1);
-
- }
-
- }
-
-
-
- /* content disposition */
-
- {
-
- zval *dispo_file = GET_PROP(obj, dispoFile);
-
- if (Z_STRLEN_P(dispo_file)) {
-
- zval *dispo_inline = GET_PROP(obj, dispoInline);
-
- http_send_content_disposition(Z_STRVAL_P(dispo_file), Z_STRLEN_P(dispo_file), (zend_bool) Z_LVAL_P(dispo_inline));
-
- }
-