From: konn Date: Mon, 24 Mar 2008 10:31:20 +0000 (+0000) Subject: * Fixed Bug. X-Git-Tag: v0.12.20~835 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=945054e23a5a6d58aa01ee210e224d182453e8f0;p=modchxj%2Fmod_chxj.git * Fixed Bug. - When mpeg is downloaded, it memory a large amount of consumes it. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_9_0@1914 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- diff --git a/include/mod_chxj.h b/include/mod_chxj.h index 1f336734..6a2ec869 100644 --- a/include/mod_chxj.h +++ b/include/mod_chxj.h @@ -58,6 +58,8 @@ #define STRCASEEQ(a,b,c,d) \ ((((a) == *(d))|| ((b) == *(d))) && strcasecmp((c),(d)) == 0) +#define STRNCASEEQ(a,b,c,d,e) \ + ((((a) == *(d))|| ((b) == *(d))) && strncasecmp((c),(d),(e)) == 0) #include "qs_ignore_sp.h" #include "qs_log.h" diff --git a/src/mod_chxj.c b/src/mod_chxj.c index 4c5ff499..e5f94ae3 100644 --- a/src/mod_chxj.c +++ b/src/mod_chxj.c @@ -639,6 +639,29 @@ chxj_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) && !f->r->prev) f->r->chunked = 1; } + if (r->content_type) { + if (! STRNCASEEQ('t','T',"text/html",r->content_type, sizeof("text/html")-1) + && ! STRNCASEEQ('t','T',"text/xml", r->content_type, sizeof("text/xml")-1) + && ! (STRNCASEEQ('i','I',"image/", r->content_type, sizeof("image/") -1) + && ( STRCASEEQ('j','J',"jpeg", &r->content_type[6]) /* JPEG */ + || STRCASEEQ('j','J',"jp2", &r->content_type[6]) /* JPEG2000 */ + || STRCASEEQ('j','J',"jpeg2000", &r->content_type[6]) /* JPEG2000 */ + || STRCASEEQ('j','J',"jpeg2000-image", &r->content_type[6]) /* JPEG2000 */ + || STRCASEEQ('x','X',"x-jpeg2000-image",&r->content_type[6]) /* JPEG2000 */ + || STRCASEEQ('p','P',"png", &r->content_type[6]) /* PNG */ + || STRCASEEQ('x','X',"x-png", &r->content_type[6]) /* PNG */ + || STRCASEEQ('g','G',"gif", &r->content_type[6])))) { /* GIF */ + + DBG(r, "not convert content-type:[%s]", r->content_type); + ap_pass_brigade(f->next, bb); + return APR_SUCCESS; + } + } + else { + DBG(r, "not convert content-type:[(null)]"); + ap_pass_brigade(f->next, bb); + return APR_SUCCESS; + } dconf = ap_get_module_config(r->per_dir_config, &chxj_module); entryp = chxj_apply_convrule(r, dconf->convrules);