httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@ukweb.com>
Subject Bug-ish sets chunked encoding
Date Mon, 19 Aug 1996 14:13:14 GMT
There seems to a bug in set_keepalive which sets chunked encoding in
HTTP/1.1 responses in some cases. At least, I think it is a bug
since it is a side-effect in an if expression.... I'll include a patch for
this below, in case it does need fixing.

Incidently, I noticed this when a module I was writting had the following
handler code:

 {
   send_http_header(r);
   rprintf(r, ....);
   rprintf(r, ....);
   ...
   return OK;
 }

This actually output in chunked format (due to the probable bug above)!
But the interesting thing is that I didn't realise that the BUFF stuff
could convert normal API output into chunked encoding. If this does work,
and isn't just an accident, does that mean that the output from (say) the
includes module could be chunked, thus getting around the problem of not
knowing the content-length in advance?

Or, the output from the error handler could use rprintf instead of bvputs,
and get the error messages output chunked?

Paul

*** http_protocol.c	Mon Aug 19 09:03:37 1996
--- http_protocol.c.fix	Mon Aug 19 16:11:06 1996
***************
*** 287,293 ****
      if ((r->server->keep_alive > r->connection->keepalives) &&
  	(r->server->keep_alive_timeout > 0) &&
  	(r->header_only || length ||
! 	 ((r->proto_num >= 1001) && (r->byterange > 1 || (r->chunked = 1))))
&&
  	(!find_token(r->pool, conn, "close")) &&
  #ifdef FORHTTP11
  	((proto_num >= 1001) || find_token(r->pool, conn, "keep-alive"))) {
--- 287,293 ----
      if ((r->server->keep_alive > r->connection->keepalives) &&
  	(r->server->keep_alive_timeout > 0) &&
  	(r->header_only || length ||
! 	 ((r->proto_num >= 1001) && (r->byterange > 1 || (r->chunked ==
1)))) &&
  	(!find_token(r->pool, conn, "close")) &&
  #ifdef FORHTTP11
  	((proto_num >= 1001) || find_token(r->pool, conn, "keep-alive"))) {



Mime
View raw message