You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Marten Lehmann <le...@cnm.de> on 2004/07/26 22:43:05 UTC

[users@httpd] more output than send by the script?

Hello,

my script creates the following output:

Content-Type: text/plain

domain: test.de
status: taken

However, what apache sends is the following:

HTTP/1.1 200 OK
Date: Mon, 26 Jul 2004 20:33:01 GMT
Server: Apache/1.3.29 (Unix) mod_perl/1.28 mod_ssl/2.8.16 OpenSSL/0.9.6b 
PHP/4.3.4
Transfer-Encoding: chunked
Content-Type: text/plain

1e
domain: test.de
status: taken

0

1e obviously is the count of bytes for the two lines my script sends. 
While it might be nice to know the total bytes of a long download 
upfront sometimes, in my case it's just interfering. How can I change 
this behavior? I guess I have to send a certain header from the 
client-side. Is there also a way from the Apache side?

Regards
Marten

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Nick Kew <ni...@webthing.com>.
On Mon, 26 Jul 2004, Joshua Slive wrote:

> If you client can't deal with this, then it isn't an HTTP/1.1 client,
> and it should therefore be sending HTTP/1.0 requests, not HTTP/1.1
> requests.  That, in turn, should prevent apache from chunking.

mod_proxy_html normally sets chunked encoding on http/1.1 requests
whenever it processes them.  I got a lot of reports of MSIE falling
over in a heap, so I added a check for force-response-1.0 and the
mod_proxy_html webpage now recommends it as a BrowserMatch for MSIE.

This is probably the same thing.

-- 
Nick Kew

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Joshua Slive <js...@gmail.com>.
On Mon, 02 Aug 2004 21:52:20 +0200, Marten Lehmann <le...@cnm.de> wrote:
> Hello,
> 
> once again.
> 
> I was successful with disabling chunked encoding with
> 
> BrowserMatch .* force-response-1.0 downgrade-1.0 nokeepalive
> 
> However, I'm not very happy with this. Especially, because maybe I'll
> move from Apache to Tomcat for this application later and there might be
> no chance to force the same behavior. Also, I don't like to use HTTP/1.0
> with the Host header, because AFAIK the host-header _may_ work with
> HTTP/1.0, but not every http-server is required to support this. 

Whew.  You're stubborn about that one.  In the real world, ALL servers
will handle the Host header on HTTP/1.0 requests.  Until recently, a
very large portion of web browsers only supported HTTP/1.0, but all of
these browsers used the Host header because many sites are
innaccesible without it.

As far as I know, there is no way for an HTTP/1.1 client to request no
chunking.  (But I'm not a protocol expert, so I may be wrong.)  But
again, if you want to make requests using HTTP, you should really
bite-the-bullet and use a proper client library, regardless of the
extra complication.

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Marten Lehmann <le...@cnm.de>.
Hello,

once again.

I was successful with disabling chunked encoding with

BrowserMatch .* force-response-1.0 downgrade-1.0 nokeepalive

However, I'm not very happy with this. Especially, because maybe I'll 
move from Apache to Tomcat for this application later and there might be 
no chance to force the same behavior. Also, I don't like to use HTTP/1.0 
with the Host header, because AFAIK the host-header _may_ work with 
HTTP/1.0, but not every http-server is required to support this. My 
problem is, that I have to build a simple http-client for perl and php. 
And since it shall be available within a certain toolkit for a wide 
range of users, I can't rely on any modules in perl or PHP-PEAR. To 
disable keep-alive connections, I can send a

Connection: close

header. But what do I have to send to inform the webserver, that I can't 
handle chunked encoding?

Accept-Encoding: none

doesn't work.

Accept-Encoding: plain

doesn't work either. I'm not that familar with http and I couldn't find 
the information in the RFCs.

Regards
Marten

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 27 Jul 2004 19:59:53 +0200, Marten Lehmann <le...@cnm.de> wrote:
> Hello,
> 
> >><VirtualHost 192.168.33.33:80>
> >>         DocumentRoot /vrmd/config/webs/api
> >>         ServerName api
> >>         SetEnv force-response-1.0
> >>         SetEnv downgrade-1.0
> >>         SetEnv nokeepalive
> >></VirtualHost>
> >>
> >>nokeepalive definitely works, but the output still is
> >
> >
> > Strange.  Something is wrong there.
> 
> 192.168.33.33:80 is defined as NameVirtualHost. Is maybe just not
> possible for NameVirtualHosts to change a certain behavior?

More likely, SetEnv is just acting too late to do any good.  It would
probably work with something like
SetEnvIf Remote_Addr . downgrade-1.0

But, as I've said, that is not the best solution.  (The best solution
is to use a real HTTP/1.1 client library that will correctly handle
the protocol rather than a nasty hack of just sending a request down
the line and hoping you get back something you can understand.  The
second best solution is to use HTTP/1.0 which is much simpler and
therefore doesn't create as many problems for your nasty hack.)

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Marten Lehmann <le...@cnm.de>.
Hello,

>><VirtualHost 192.168.33.33:80>
>>         DocumentRoot /vrmd/config/webs/api
>>         ServerName api
>>         SetEnv force-response-1.0
>>         SetEnv downgrade-1.0
>>         SetEnv nokeepalive
>></VirtualHost>
>>
>>nokeepalive definitely works, but the output still is
> 
> 
> Strange.  Something is wrong there.

192.168.33.33:80 is defined as NameVirtualHost. Is maybe just not 
possible for NameVirtualHosts to change a certain behavior?

Regards
Marten Lehmann

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Joshua Slive <js...@gmail.com>.
On Tue, 27 Jul 2004 19:31:51 +0200, Marten Lehmann <le...@cnm.de> wrote:
> Hello,
> 
> > If you client can't deal with this, then it isn't an HTTP/1.1 client,
> > and it should therefore be sending HTTP/1.0 requests, not HTTP/1.1
> > requests.
> 
> it isn't really a "client", but just a script that sends
> 
> GET / HTTP/1.1
> Host: api
> 
> Without HTTP/1.1, there's no host-header.

Wrong.  You can certainly send the Host: header with HTTP/1.0.  In
fact, essentially all HTTP/1.0 clients have done this for years.  It
is note *required* by HTTP/1.0, but it is certainly allowed.

> > Alternatively, you could try
> > SetEnv downgrade-1.0
> 
> I tried, this is my definition:
> 
> <VirtualHost 192.168.33.33:80>
>          DocumentRoot /vrmd/config/webs/api
>          ServerName api
>          SetEnv force-response-1.0
>          SetEnv downgrade-1.0
>          SetEnv nokeepalive
> </VirtualHost>
> 
> nokeepalive definitely works, but the output still is

Strange.  Something is wrong there.  But it doesn't really matter. 
Just use HTTP/1.0 from your "client".

Joshua.

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Marten Lehmann <le...@cnm.de>.
Hello,

> If you client can't deal with this, then it isn't an HTTP/1.1 client,
> and it should therefore be sending HTTP/1.0 requests, not HTTP/1.1
> requests.

it isn't really a "client", but just a script that sends

GET / HTTP/1.1
Host: api

Without HTTP/1.1, there's no host-header.

> Alternatively, you could try
> SetEnv downgrade-1.0

I tried, this is my definition:

<VirtualHost 192.168.33.33:80>
         DocumentRoot /vrmd/config/webs/api
         ServerName api
         SetEnv force-response-1.0
         SetEnv downgrade-1.0
         SetEnv nokeepalive
</VirtualHost>

nokeepalive definitely works, but the output still is

HTTP/1.1 200 OK
Date: Tue, 27 Jul 2004 17:26:14 GMT
Server: Apache/1.3.29 (Unix) mod_perl/1.28 mod_ssl/2.8.16 OpenSSL/0.9.6b 
PHP/4.3.4
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain

1e
domain: test.de
status: taken

0

Anx ideas? Can I send a certain header with the GET-request to prevent 
apache from using chunked encoding, but send as is?

Regards
Marten

---------------------------------------------------------------------
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


Re: [users@httpd] more output than send by the script?

Posted by Joshua Slive <js...@gmail.com>.
On Mon, 26 Jul 2004 22:43:05 +0200, Marten Lehmann <le...@cnm.de> wrote:

> However, what apache sends is the following:
> 
> HTTP/1.1 200 OK
> Date: Mon, 26 Jul 2004 20:33:01 GMT
> Server: Apache/1.3.29 (Unix) mod_perl/1.28 mod_ssl/2.8.16 OpenSSL/0.9.6b
> PHP/4.3.4
> Transfer-Encoding: chunked
> Content-Type: text/plain
> 
> 1e
> domain: test.de
> status: taken
> 
> 0
> 
> 1e obviously is the count of bytes for the two lines my script sends.
> While it might be nice to know the total bytes of a long download
> upfront sometimes, in my case it's just interfering. How can I change
> this behavior? I guess I have to send a certain header from the
> client-side. Is there also a way from the Apache side?

Notice the "Transfer-Encoding: chunked" line.  Apache is sending
chunked transfer encoding because it doesn't know the length in
advance.

If you client can't deal with this, then it isn't an HTTP/1.1 client,
and it should therefore be sending HTTP/1.0 requests, not HTTP/1.1
requests.  That, in turn, should prevent apache from chunking.

Alternatively, you could try
SetEnv downgrade-1.0
in httpd.conf.  See:
http://httpd.apache.org/docs/env.html#special

Joshua.

---------------------------------------------------------------------
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