Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 12:04:55 PM

Pages: [1]   Go Down
  Print  
Author Topic: HELP! Avoid http header Connection: close  (Read 331 times)
anders0x
Newbie
*
Offline Offline

Posts: 4


WWW
« on: July 13, 2002, 06:21:00 AM »

I have a big problem. I need to avoid the http
response header "Connection: close". It seems to
be added by the web server outside my control.

I have tried obvious things like in php
 header("Connection: Keep-Alive", true);
or just
 header("Connection: ");

but that results in the rather unexpected output
of the type
Connection: Keep-Alive, close

which is just as bad, as the close statement
is still there.

Background for the need is that if the
Connection close statement is sent, the
WAP Gateway of many operators make buggy things,
and that is outside my control.

If not solvable, I will need to change to a
Microsoft-based hosting company, where I know
it can be solved. And how fun would that feel???
Logged
Max
Über Jedi
*****
Offline Offline

Posts: 2534



WWW
« Reply #1 on: July 13, 2002, 06:44:00 AM »

We use apache if that would help. There should be documentation about it out there somewhere.

If you find your anwer please, send an email to support@lunarpages.com and ask to make a change to the configuration of your account.

Anyone else have any input?
Logged
anders0x
Newbie
*
Offline Offline

Posts: 4


WWW
« Reply #2 on: July 14, 2002, 05:49:00 AM »

Well Keep-Alive is default on in Apache, so that
is not the problem unless the normal user
configs are weird. See
http://httpd.apache.org/docs/mod/core.html#keepalive

Can my php program make Apache believe I will
send more on this connection later, to avoid
it putting in the Connection: close

Or can I return a file (gif or jpeg) from a
Perl script instead, using nph (non-parsed-header) or is that difficult?
Logged
Max
Über Jedi
*****
Offline Offline

Posts: 2534



WWW
« Reply #3 on: July 14, 2002, 03:23:00 PM »

The server configuration cannot be changed as it is used by everyone.

For php you should search for the string on google etc. Or use the appropiate lunarpages forums. You might get help from other Lunarpages users.

Support is unfortunately limited in giving support to 3rd party products or help you with your programming. As our resources are limited  "[Frown]"
There is not enough hours per day unfortunately.

But we will give you a few hints. And lead you into the right direction.
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #4 on: July 15, 2002, 12:38:00 AM »

I would look in my include files, etc for a close command.  It's gotta be in there.  The connection is left open by default until closed by a script, or until 4 attempts to a user who has closed their browser or moved on.

If you are using a program like Dreamweaver, it may put a close command in a support script that would be referenced by an include.

I am positive (if you are on neptune anyway) that there is no close command programmed into the server.  Also check your MySQL section in your CPanel.
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
anders0x
Newbie
*
Offline Offline

Posts: 4


WWW
« Reply #5 on: July 15, 2002, 04:32:00 PM »

Thanks! I've found out a work-around now:
With perl nph scrips (non-parsed headers) I can send any header. I tried that but missed that the actual script name needs to be called nph-xxxx.pl

Then it's just to print the full header to stdout and I can write whatever I like, including *not* writing the Connection: close
 "[Smile]"

So case closed. In php, it appears to be not
possible though.

Excellent tool for debugging http headers:
 cg-eye

And here's the perl source for my nph script:
nph-gif.pl

 
code:
#!/usr/bin/perl

$file = "./pics/test.gif";

$server_protocol = $ENV{'SERVER_PROTOCOL'};
$server_software = $ENV{'SERVER_SOFTWARE'};
print "$server_protocol 200 OK", "\n";
print "Server: $server_software", "\n";
print "Date: Mon, 15 Jul 2002 10:20:49 GMT\n";
print "Accept-Ranges: bytes\n";
print "Content-type: image/gif\n";
print "Content-Length: 2650\n";
print "Last-Modified: Fri, 28 Jun 2002 20:04:24 GMT\n";
print "Set-Cookie: server=1\n";

print "\n";

binmode(STDOUT);
open(IMAGE, "<$file") || die "Can't open $file: $!";
while (<IMAGE>)
{
   print $_;
}
close(IMAGE);

exit (0);
 

Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #6 on: July 17, 2002, 09:03:00 PM »

Very nice!  Nice tool too.

My Fluid dynamics tracking script, when put in debug mode, gives me all sorts of server info too.  It can come in very handy when troubleshooting.
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
Pages: [1]   Go Up
  Print  
 
Jump to: