[cgiapp] questions about C::A::Server

Bradley C Bailey cgiapp at brad.memoryleak.org
Mon Jan 19 17:53:04 EST 2009


Michael,

> I'm experimenting with moving Smolder over to C::A::Server (to remove 
> the dependency on Apache and make it CPANable and thus easier to package 
> for distributions). Things are going ok so far, but I have a few questions.
> 
> 1) Is there a way to control the HTTP response codes? I used to send a 
> 401 response along with the "forbidden" page when someone tried to 
> access something they shouldn't. I'd like to continue that if possible.
> 
> 2) C::A::P::Stream seems to have issues when run under C::A::Server. It 
> seems that the HTTP headers it's trying to set are being interpreted as 
> being part of the file. So I loose the content-type header and my file 
> is corrupted.
> 
> 3) It prints to the screen a lot of information, that while useful for 
> developing, I will eventually want to turn off for distribution. I'm 
> planning on daemonizing it, so I guess I could just redirect that 
> output, but that's what I was planning on doing for the error log, and 
> having all those urls, etc in the error log would be a bit much since 
> they aren't errors.
> 
> Thoughts?

I mostly use CA::Server for development, but I think your plan sounds good.

I ran into the same issue with CA::Server and CAP::Stream recently.  See 
the patch I sent to the list on 12/28 for a workaround.  It is not ideal 
though.

I think CA::Server will need some re-architecting to allow setting HTTP 
response codes and to stream files properly.  Right now it expects to 
have all of the headers and output before it sends the HTTP response.  I 
have not had time to really sit down and think about how it should be 
done instead, or what other modules would be affected.

Regards,
Bradley C Bailey



More information about the cgiapp mailing list