httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Korthof ...@organic.com>
Subject AOL Patch
Date Fri, 20 Dec 1996 18:51:31 GMT
This patch is based on Randy's BrowserMatch patch -- it's just
significantly uglier.  Unfortunately, Randy's patch doesn't allow for
authentication (at least for us).  I was wrong about subprocess_env
getting clobbered;  rather, mod_auth is called before mod_browser, so the
environmental variables are never set, and the server doesn't know to send
HTTP/1.0 when requesting authentication.

If I knew more about how the modules are called, I might try to fix the
sequence, but I'm still learning how Apache works.  This patch fixes the
problem for both authenticated and non-authenticated sessions (we've
tested it minimally); I would not want to see this go into any released
version of Apache, but for people who need to provide service to AOL
clients Randy's or this patch should be available.  Can we put one in the
contributions section until AOL gets their act together?

A line with five dashes comes before and after the patch.

-----
*** http_protocol_old.c	Thu Dec 19 17:55:02 1996
--- http_protocol.c	Fri Dec 20 10:36:30 1996
***************
*** 870,885 ****
  }
  
  
  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);
--- 870,891 ----
  }
  
  
+ regex_t * reg_aolmatch;
+ 
  void basic_http_header (request_rec *r)
  {
+     char * ua = table_get(r->headers_in, "User-Agent");
      BUFF *fd = r->connection->client;
      
      if (r->assbackwards) return;
      
!     if (!(r->status_line))
          r->status_line = status_lines[index_of_response(r->status)];
! 
!     if (ua && !regexec(reg_aolmatch,ua,0, NULL, 0))
!         bvputs(fd, "HTTP/1.0", " ", r->status_line, "\015\012", NULL);
!     else
!         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);
*** /usr/local/src/apache/apache_1.2b2/src/http_main.c	Mon Dec  9 17:11:58 1996
--- http_main.c	Fri Dec 20 09:21:01 1996
***************
*** 1770,1776 ****
--- 1770,1785 ----
   */
  
  static int num_children = 0;
+ extern regex_t * reg_aolmatch;
  
+ void setup_AOL_regex() {
+     reg_aolmatch = malloc(sizeof(regex_t));
+     if (regcomp (reg_aolmatch,"AOL", REG_EXTENDED|REG_NOSUB|REG_ICASE))
+     {
+         exit(1);
+     }
+ }
+ 
  void standalone_main(int argc, char **argv)
  {
      struct sockaddr_in sa_server;
***************
*** 1822,1827 ****
--- 1831,1837 ----
      server_conf = read_config(pconf, ptrans, server_confname); 
      open_logs(server_conf, pconf);
      set_group_privs();
+     setup_AOL_regex();
      accept_mutex_init(pconf);
      reinit_scoreboard(pconf);
-----      


     -- Ed Korthof        |  Web Server Engineer --
     -- ed@organic.com    |  Organic Online, Inc --
     -- (415) 278-5676    |  Fax: (415) 284-6891 --



Mime
View raw message