httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Korthof" ...@organic.com>
Subject Re: AOL, BrowserMatch, allow/deny
Date Mon, 23 Dec 1996 22:11:54 GMT
Without an extra API, there aren't any elegant ways I can see to fix the AOL
problem, but we have at least three patches floating around.  It sounds like
the consensus is that no one really wants to add the API right now, so IMO, we
should put one or two patches in the patches directory, describe them and
explain how to implement them, and let it go at that.  Maybe AOL will fix their
software soon, maybe not...

Anyway, here's my patch, adapted to break AOL's proxies if AOL_DIE_DIE_DIE is
set.  However, I would add that the cache-busting mechanism is not, so far as I
know, the issue; if AOL hadn't cached it's failures, then that would help, but
since they're already cached, telling AOL not to cache new things isn't going
to do any good -- you'll still have to wait till their old cache expires.  This
patch requires only recompilation, and allows both authentication and ordinary
operation:

-----
*** http_main.c	Fri Dec 20 14:19:49 1996
--- http_main-n.c	Fri Dec 20 14:19:35 1996
***************
*** 1770,1775 ****
--- 1770,1784 ----
   */

  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)
  {
***************
*** 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);

*** http_protocol_old.c	Thu Dec 19 17:55:02 1996
--- http_protocol-n.c	Mon Dec 23 13:42:58 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,899 ----
  }


+ 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))
!     {
!         set_last_modified(r, r->request_time);
!         bvputs(fd, "HTTP/1.0", " ", r->status_line, "\015\012", NULL);
! #ifdef AOL_DIE_DIE_DIE
!         bvputs(fd, "Pragma: no-cache\015\012", NULL);
!         r->no_cache = 1;
! #endif
!         bvputs(fd, "X-Message: AOL, fix your bloody proxy code\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);
-----

Randy's/Rob's patch fixes ordinary operation, but doesn't allow for
authentication.  I can't find Rob's, but from what I can recall, it's basically
equivalent to this one (except that it sends extra header lines).  This
requires the addition of the lines

BrowserMatch	"AOL"	forceoldproto
BrowserMatch	"aol"	forceoldproto

to one of the .conf files (httpd.conf works, don't know about the others).

Here's Randy's version, with an addition to send the X-message to AOL as per
Rob's patch.  It would be easily adapted to break AOL's cache by putting the
following w/in the added 'if' clause:

          bvputs(fd, "Pragma: no-cache\015\012", NULL);
          r->no_cache = 1;

-----
*** http_protocol.c	1996/12/17 20:52:12	1.84
---- http_protocol.c	1996/12/17 22:34:16
***************
*** 878,884 ****
      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,891 ----
      if (!r->status_line)
          r->status_line = status_lines[index_of_response(r->status)];

!     if (table_get(r->subprocess_env, "forceoldproto"))
!     {
!         bvputs(fd, "HTTP/1.0", " ", r->status_line, "\015\012", NULL);
!         bvputs(fd, "X-Message: AOL, fix your bloody proxy
code\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);
-----

I'm about ready to forget AOL... when they fix their proxies, I'll remove my
patch.  I would advise against putting any of these in a release; if we had to
put one of them in a release, however, I'd suggest using something like the
above patch.

On Dec 23, 12:45pm, Alexei Kosut wrote:
> Subject: Re: AOL, BrowserMatch, allow/deny
> On Mon, 23 Dec 1996, Ben Laurie wrote:
>
> > As I mentioned before, to get a complete solution to AOL we really need an
> > extra API to parse headers before anything else happens. This would also
tidy
> > up the allow/deny stuff. I'm prepared to ruin my pre-Christmas Eve evening
> > preparing such a fix if you lot are prepared to let me commit it.
>
> As I said before, I don't believe this is the time. As I pointed out,
> there are at least three API phases I'd like to add. There are more,
> too, besides those three, that I remembered just now: People had
> requested an API hook for when a child forked and started (for database
> connectivity and such). Also, thinking about SSL and such, I imagine
> you'd need a "pre-connection" phase, for when the connection had just
> opened, but before the first request had been read. So that any
> connection-wide filters and handshaking can be done.
>
> So that's five right there (child-start, pre-connection, pre-header,
> pre-body, post-body). I support adding them all in Apache 2.0, I just
> don't think 1.2b3 is the right place or time for them.
>
> > On the question of how to fix AOL (by 1.0 response or by cache busting), I
>
> Actually, it's by 1.0 response or 1.0 response *and* cache
> busting. At least, that's my understanding.
>
> --
> ________________________________________________________________________
> Alexei Kosut <akosut@nueva.pvt.k12.ca.us>      The Apache HTTP Server
> URL: http://www.nueva.pvt.k12.ca.us/~akosut/   http://www.apache.org/
>-- End of excerpt from Alexei Kosut



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

Mime
View raw message