From b85162590da032ed9899f84f0f48fa1ade35df32 Mon Sep 17 00:00:00 2001 From: George Schlossnagle Date: Tue, 8 Oct 2002 02:17:02 +0000 Subject: sync with head. add optional content type param to send_http_header --- sapi/apache/mod_php4.c | 3 +-- sapi/apache/php_apache.c | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index b3f70e5ebe..1f75b3dd5c 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -410,8 +410,7 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_ */ static int php_apache_startup(sapi_module_struct *sapi_module) { - if (php_module_startup(sapi_module) == FAILURE - || zend_startup_module(&apache_module_entry) == FAILURE) { + if (php_module_startup(sapi_module, &apache_module_entry, 1) == FAILURE) { return FAILURE; } else { return SUCCESS; diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index eaa34ddce8..24b580f8b3 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -958,8 +958,15 @@ PHP_FUNCTION(apache_request_send_http_header) { zval *id; request_rec *r; + char *type = NULL; + int typelen; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &typelen) == FAILURE) + return; APREQ_GET_REQUEST(id, r); + if(type) { + r->content_type = pstrdup(r->pool, type); + } ap_send_http_header(r); AP(headers_sent) = 1; RETURN_TRUE; @@ -1324,6 +1331,7 @@ static function_entry php_apache_request_class_functions[] = { #undef some_auth_required #undef update_mtime #undef send_http_header +#undef send_header_field #undef basic_http_header #undef send_http_trace #undef send_http_options -- cgit v1.2.1