httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiffin Gish <Kiffin.G...@tomtom.com>
Subject Re: ap_custom_response content type 'text/xml'
Date Thu, 26 Jun 2008 18:13:27 GMT
Don't see filter type HTTP_HEADER, is this also part of apache 2.2.x?

On Thu, 2008-06-26 at 16:36 +0200, "Plüm, Rüdiger, VF-Group" wrote:
> 
> > -----Ursprüngliche Nachricht-----
> > Von: Brian J. France 
> > Gesendet: Donnerstag, 26. Juni 2008 16:29
> > An: dev@httpd.apache.org
> > Betreff: Re: ap_custom_response content type 'text/xml'
> > 
> > 
> > On Jun 26, 2008, at 9:48 AM, Kiffin Gish wrote:
> > > Thanks Brian, I've tried what you suggested but it doesn't seem to  
> > > work.
> > > Could you be more specific? Here's what I've tried:
> > >
> > > void register_hooks(apr_pool_t *p)
> > > {
> > >     ap_hook_translate_name(hook_translate_name, NULL, NULL,
> > > APR_HOOK_REALLY_FIRST);
> > >     ap_hook_pre_connection(hook_pre_connection, NULL, NULL,
> > > APR_HOOK_MIDDLE);
> > >     ap_register_output_filter("wms-error-http-header",  
> > > wmserror_ofilter,
> > >             NULL, AP_FTYPE_CONNECTION) ;
> > > }
> > >
> > > static int hook_translate_name (request_rec *r)
> > > {
> > >     apr_table_setn(r->notes, "MY_NOTE", ".");
> > >     ap_custom_response(r, HTTP_INTERNAL_SERVER_ERROR, xml);
> > >     return HTTP_INTERNAL_SERVER_ERROR;
> > > }
> > >
> > > static int hook_pre_connection(conn_rec *c, void *csd)
> > > {
> > >     ap_add_output_filter("wms-error-httpd-header", NULL, NULL, c);
> > >     return OK;
> > > }
> > >
> > > int wmserror_ofilter(ap_filter_t* f, apr_bucket_brigade* bb)
> > > {
> > >     const char *t = apr_table_get(f->r->notes, "MY_NOTE");
> > >     if (t != NULL) { ap_set_content_type(f->r, "text/xml"); }
> > >     return ap_pass_brigade(f->next, bb) ;
> > > }
> > >
> > 
> > My guess would be you can't use ap_set_content_type in your filter,  
> > you will have to examine the buckets, find Conetent-Type and 
> > change it  
> > to text/xml.
> 
> You can, but you must ensure that your filter runs before the http header
> filter (HTTP_HEADER).
> 
> Regards
> 
> Rüdiger
> 
-- 
Kiffin Gish | Desktop & Services Development | TomTom | kiffin.gish@tomtom.com | +31 (0)
6 15529214 mobile | +31 (0) 20 757 5000 office


This e-mail message contains information which is confidential and may be privileged. It is
intended for use by the addressee only. If you are not the intended addressee, we request
that you notify the sender immediately and delete or destroy this e-mail message and any attachment(s),
without copying, saving, forwarding, disclosing or using its contents in any other way. TomTom
N.V., TomTom International BV or any other company belonging to the TomTom group of companies
will not be liable for damage relating to the communication by e-mail of data, documents or
any other information.

Mime
View raw message