httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "HE Hongmei" <Hongmei...@alcatel-lucent.com>
Subject RE: [users@httpd] Help: HTTP response has wrong Content-Type field
Date Sat, 24 Oct 2009 12:49:10 GMT


Thank you very much for the response. 

We finally got the root cause. When we used the following code to set
content type, there will be problem. The reason is that Apache
ap_set_content_type does not copy the content to
request_rec::content_type, it only use the "const char*" pointer. When
our_module_handler returns, the pointer is released, so some strange
data is in content_type, and put back to HTTP response. We resolved it
by defining some "const char*" variables and set with them when calling
ap_set_content_type.

int our_module_handler(request_rec *r)
{
	....
	String data="<some value>"
	ap_set_content_type(r, data.c_str());
	....
}

Hongmei 

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Saturday, October 24, 2009 9:13 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Help: HTTP response has wrong Content-Type
field

On Fri, Oct 23, 2009 at 8:59 PM, HE Hongmei
<Hongmei.He@alcatel-lucent.com> wrote:
>
> We added some logs before and after the above calls, and found the 
> content-type is always right. However, sometimes (not always), in the 
> response sent by Apache server, Content-Type will be changed to 
> something like "application/user-config" or 
> "application/user-config+xm", or some other values.

I suspect its your modules own misuse of r->pool.  Completely gut all of
your actual logic from your module and see if it still truncates the
header.

Or start with a new module that just sets the content type and prints a
canned response.

--
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message