diff options
author | Bill Stoddard <stoddard@apache.org> | 2002-03-20 01:58:47 +0000 |
---|---|---|
committer | Bill Stoddard <stoddard@apache.org> | 2002-03-20 01:58:47 +0000 |
commit | 470edb9dd87afbdb66ed0fd36bce7c97c2889086 (patch) | |
tree | ad6aede0f24e3c782a4714c9f1f9105c13e92020 /modules/http/mod_mime.c | |
parent | 32fe8d097ff4e9ab319321b796b1ca6db191097a (diff) | |
download | httpd-470edb9dd87afbdb66ed0fd36bce7c97c2889086.tar.gz |
First commit to introduce accessor function to set r->content_type..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94027 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http/mod_mime.c')
-rw-r--r-- | modules/http/mod_mime.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/http/mod_mime.c b/modules/http/mod_mime.c index 7eaab71a3e..c4cd832c1a 100644 --- a/modules/http/mod_mime.c +++ b/modules/http/mod_mime.c @@ -76,7 +76,7 @@ #include "http_config.h" #include "http_log.h" #include "http_request.h" - +#include "http_protocol.h" /* XXXX - fix me / EBCDIC * there was a cludge here which would use its @@ -744,7 +744,7 @@ static int find_ct(request_rec *r) int found_metadata = 0; if (r->finfo.filetype == APR_DIR) { - r->content_type = DIR_MAGIC_TYPE; + ap_rset_content_type(DIR_MAGIC_TYPE, r); return OK; } @@ -793,7 +793,7 @@ static int find_ct(request_rec *r) if (exinfo == NULL || !exinfo->forced_type) { if ((type = apr_hash_get(mime_type_extensions, ext, APR_HASH_KEY_STRING)) != NULL) { - r->content_type = type; + ap_rset_content_type((char*) type, r); found = 1; } } @@ -801,7 +801,7 @@ static int find_ct(request_rec *r) if (exinfo != NULL) { if (exinfo->forced_type) { - r->content_type = exinfo->forced_type; + ap_rset_content_type(exinfo->forced_type, r); found = 1; } @@ -885,29 +885,29 @@ static int find_ct(request_rec *r) if ((ctp = analyze_ct(r, r->content_type))) { param *pp = ctp->param; - r->content_type = apr_pstrcat(r->pool, ctp->type, "/", - ctp->subtype, NULL); + ap_rset_content_type(apr_pstrcat(r->pool, ctp->type, "/", + ctp->subtype, NULL), r); while (pp != NULL) { if (charset && !strcmp(pp->attr, "charset")) { if (!override) { - r->content_type = apr_pstrcat(r->pool, r->content_type, - "; charset=", charset, - NULL); + ap_rset_content_type(apr_pstrcat(r->pool, r->content_type, + "; charset=", charset, + NULL), r); override = 1; } } else { - r->content_type = apr_pstrcat(r->pool, r->content_type, - "; ", pp->attr, - "=", pp->val, - NULL); + ap_rset_content_type(apr_pstrcat(r->pool, r->content_type, + "; ", pp->attr, + "=", pp->val, + NULL), r); } pp = pp->next; } if (charset && !override) { - r->content_type = apr_pstrcat(r->pool, r->content_type, - "; charset=", charset, - NULL); + ap_rset_content_type(apr_pstrcat(r->pool, r->content_type, + "; charset=", charset, + NULL), r); } } } |