httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Protocol forcing patch
Date Sun, 05 Jan 1997 14:10:01 GMT
This patch allows you to force a response in a particular protocol by setting
the environment variable "FORCE_PROTOCOL" to the desired protocol, as in:

BrowserMatch AOL FORCE_PROTOCOL=HTTP/1.0

Cheers,

Ben.

Index: http_protocol.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_protocol.c,v
retrieving revision 1.87
diff -c -r1.87 http_protocol.c
*** http_protocol.c	1997/01/01 18:10:21	1.87
--- http_protocol.c	1997/01/05 15:14:51
***************
*** 878,890 ****
  void basic_http_header (request_rec *r)
  {
      BUFF *fd = r->connection->client;
      
      if (r->assbackwards) return;
      
      if (!r->status_line)
          r->status_line = status_lines[index_of_response(r->status)];
      
!     bvputs(fd, SERVER_PROTOCOL, " ", r->status_line, "\015\012", NULL);
      bvputs(fd,"Date: ",gm_timestr_822 (r->pool, r->request_time),
  	   "\015\012", NULL);
      bvputs(fd,"Server: ", SERVER_VERSION, "\015\012", NULL);
--- 878,894 ----
  void basic_http_header (request_rec *r)
  {
      BUFF *fd = r->connection->client;
+     char *t;
      
      if (r->assbackwards) return;
      
      if (!r->status_line)
          r->status_line = status_lines[index_of_response(r->status)];
      
!     t=table_get(r->subprocess_env,"FORCE_PROTOCOL");
!     if(!t)
! 	t=SERVER_PROTOCOL;
!     bvputs(fd, t, " ", r->status_line, "\015\012", NULL);
      bvputs(fd,"Date: ",gm_timestr_822 (r->pool, r->request_time),
  	   "\015\012", NULL);
      bvputs(fd,"Server: ", SERVER_VERSION, "\015\012", NULL);

-- 
Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author

Mime
View raw message