Re: Update: Re: PerlSendHeader Off socket persistence (was Re:question: usingApache for non-HTML messages)
Why would the lack of a $r-send_http_header call cause socket persistence to go away? I was under the impression that $r-send_http_header only affected what was sent to the client, but appearantly it affects Apache's socket handling as well. When I don't use $r-send_http_header, my sockets are dying after Apache's response to the 1st query...dying from the apache side, not the client side. I have my test client hard-coded to keep the socket open and send keepalives on every request. Since I don't want the server to send headers, but I want socket persistence, I'm in a bind. I've tried tracing through the apache source and commenting out stuff I don't need (manually removing headers, the ugly way). However I cannot find the code segiment that prints the outbound hexidecimal message size (which I also want to remove), so I'm stuck for the moment. It seems I need to know 1 of 2 things: 1) How do you keep sockets open when $r-send_http_header isn't used 2) how can I make apache stop printing the outbound message size on each response Any help will be appreciated! Brian Doug MacEachern wrote: On Thu, 28 Sep 2000, B. Burke wrote: Once I changed how I was printing the header from the script, the socket persistence worked with PerlSendHeader Off. So I guess I solved my problem although I don't really know why. because CGI.pm will trigger a call to $r-send_http_header, regardless of PerlSendHeader settings. whereas: "print Content-type: text/html\n\n"; will not, unless PerlSendHeader is On.
Re: Update: Re: PerlSendHeader Off socket persistence (was Re:question: usingApache for non-HTML messages)
On Mon, 2 Oct 2000, B. Burke wrote: Why would the lack of a $r-send_http_header call cause socket persistence to go away? I was under the impression that $r-send_http_header only affected what was sent to the client, but appearantly it affects Apache's socket handling as well. because send_http_header calls set_keepalive underneath, set_keepalive sets the flags so apache will keep the connection open. try the patch below and add $r-set_keepalive to your code. 2) how can I make apache stop printing the outbound message size on each response what headers exactly is your client sending? you must be somehow triggering chunked encoding. Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.114 diff -u -r1.114 Apache.xs --- src/modules/perl/Apache.xs 2000/09/28 19:28:33 1.114 +++ src/modules/perl/Apache.xs 2000/10/02 21:23:28 @@ -937,6 +937,10 @@ send_http_header(r); mod_perl_sent_header(r, 1); +void +set_keepalive(r) +Apache r + #ifndef PERL_OBJECT int
Re: Update: Re: PerlSendHeader Off socket persistence (was Re:question: usingApache for non-HTML messages)
On Thu, 28 Sep 2000, B. Burke wrote: Once I changed how I was printing the header from the script, the socket persistence worked with PerlSendHeader Off. So I guess I solved my problem although I don't really know why. because CGI.pm will trigger a call to $r-send_http_header, regardless of PerlSendHeader settings. whereas: "print Content-type: text/html\n\n"; will not, unless PerlSendHeader is On.