httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@nueva.pvt.k12.ca.us>
Subject AddHandler patch and things
Date Tue, 26 Mar 1996 01:32:57 GMT
Hi..

A week or so ago, I suggested (or rather, restated what I think David
Robinson said - I'm still not quite sure if this is what he meant) a
new directive, AddHandler, that would allow the user to set r->handler
(as created by my patch of a few weeks ago) based on file
extension. Following is a patch to implement this, and related
functions.

The patch both adds the directive (a trivial task), and modifies the
rest of Apache to deal with it. What it accomplishes, and what David
explicitly wanted, is the almost complete removal of "magic" media
types from Apache. Though the support is still there, so the tens of
thousands of srm.conf files still out there still work, all the
AddTypes have been depreciated and replaced with AddHandlers. For
example, instead of "AddType application/x-httpd-cgi cgi", one should
use "AddHandler cgi-script cgi". Besides semantics, what advantage
does this have?

1) It's less confusing, simply. application/x-httpd-cgi is not really
a media type, and the distinction between media types and server
actions are more clearly defined.

2) Currently, if a script does not output a Content-type header,
Apache will send "Content-type: application/x-httpd-cgi". Oops. This
is pretty much wrong. When using AddHandler, it will send text/plain,
or whatever the default type happens to be set to.

3) You can use (2) as a feature, too. For example, you could not set
Content-type on purpose, but use a file extension to do
so. This is not so useful for CGI scripts, but is very handy for asis
files (AddHandler send-as-is asis). foo.html.asis (or foo.asis.html)
clearly identifies the file as an HTML file, without having to check
the file to find out.

4) Actions can be seperated from content type, but can still have both
(instead of just one or the other). For example, "AddType
text/x-server-parsed-html shtml" means that all parsed files end up as
text/html. But if you use "AddHandler parse-file ssi", then you can
use "foo.html.ssi" or "foo.html3.ssi" or "foo.txt.ssi" or even
"foo.gif.ssi" (though don't ask me why you'd want to).

I think it's rather useful. Especially combined with the Action
command (since AddHandler's handlers can point to those added with
Action just as easily as those built into Apache), you gain a powerful
ability to more easily modify Apache's output. An example that comes
to mind might be to use an Action to pass files through the C
pre-processor. This is not limited to any one content type, but is
equally useful for all text-based ones. You can use foo.html.cpp or
foo.cpp.txt or whatnot.

Therefore I submit the following patch for review. As I said, the
command itself is relatively straightfoward, but making the rest of
Apache take advantage of it was a bit tricky. I had to make some
changes that might break something, though I think I caught
everything. For example, in order to make the Action example above
work, I needed to have internal redirects preserve content_type. I've
unset it explicitly in the situations where this is a Bad Idea (error
documents, for example), but it might cause some problems.

At any rate, I'd like some comment on this. If I don't get any by
Thursday evening (PST), I'll assume you all love it, and I'll commit
it into Apache. Thanks! Here it is:

Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.3
diff -c -r1.3 http_request.c
*** http_request.c	1996/03/01 03:01:06	1.3
--- http_request.c	1996/03/25 06:36:06
***************
*** 563,573 ****
  	    r->no_cache = 1;	/* Do NOT send USE_LOCAL_COPY for
  				 * error documents!
  				 */
! 		/* This redirect needs to be a GET no matter what the original
! 		 * method was.
! 		 */
! 		r->method = pstrdup(r->pool, "GET");
! 		r->method_number = M_GET;
  	    internal_redirect (custom_response, r);
  	    return;
  	} else {
--- 563,575 ----
  	    r->no_cache = 1;	/* Do NOT send USE_LOCAL_COPY for
  				 * error documents!
  				 */
! 	    /* This redirect needs to be a GET no matter what the original
! 	     * method was.
! 	     */
! 	    r->method = pstrdup(r->pool, "GET");
! 	    r->method_number = M_GET;
! 	    /* One case where we don't want to preserve content-type */
! 	    r->content_type = NULL;
  	    internal_redirect (custom_response, r);
  	    return;
  	} else {
***************
*** 721,726 ****
--- 723,730 ----
      new->header_only = r->header_only;
      new->protocol = r->protocol;
      new->main = r->main;
+
+     new->content_type = r->content_type;  /* Preserve this for actions */

      new->headers_in = r->headers_in;
      new->headers_out = make_table (r->pool, 5);
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.9
diff -c -r1.9 httpd.h
*** httpd.h	1996/03/05 17:28:49	1.9
--- httpd.h	1996/03/25 06:36:09
***************
*** 252,258 ****
  #define MAP_FILE_MAGIC_TYPE "application/x-type-map"
  #define ASIS_MAGIC_TYPE "httpd/send-as-is"
  #define DIR_MAGIC_TYPE "httpd/unix-directory"
- #define PROXY_MAGIC_TYPE "httpd/proxy"

  /* Just in case your linefeed isn't the one the other end is expecting. */
  #define LF 10
--- 252,257 ----
Index: mod_actions.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_actions.c,v
retrieving revision 1.1
diff -c -r1.1 mod_actions.c
*** mod_actions.c	1996/02/22 11:46:53	1.1
--- mod_actions.c	1996/03/25 06:36:09
***************
*** 121,130 ****
  {
      action_dir_config *conf =
        (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
      char *t;

!     if (!r->content_type ||
! 	!(t = table_get(conf->action_types,  r->content_type)))
        return DECLINED;

      if (r->finfo.st_mode == 0) {
--- 121,131 ----
  {
      action_dir_config *conf =
        (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
+     char *action = r->handler ? r->handler : r->content_type;
      char *t;

!     if (!action ||
! 	!(t = table_get(conf->action_types, action)))
        return DECLINED;

      if (r->finfo.st_mode == 0) {
Index: mod_alias.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_alias.c,v
retrieving revision 1.3
diff -c -r1.3 mod_alias.c
*** mod_alias.c	1996/03/05 17:28:49	1.3
--- mod_alias.c	1996/03/25 06:36:11
***************
*** 66,72 ****
  typedef struct {
      char *real;
      char *fake;
!     char *forced_type;
  } alias_entry;

  typedef struct {
--- 66,72 ----
  typedef struct {
      char *real;
      char *fake;
!     char *handler;
  } alias_entry;

  typedef struct {
***************
*** 107,113 ****

      /* XX r can NOT be relative to DocumentRoot here... compat bug. */

!     new->fake = f; new->real = r; new->forced_type = cmd->info;
      return NULL;
  }

--- 107,113 ----

      /* XX r can NOT be relative to DocumentRoot here... compat bug. */

!     new->fake = f; new->real = r; new->handler = cmd->info;
      return NULL;
  }

***************
*** 127,133 ****
  command_rec alias_cmds[] = {
  { "Alias", add_alias, NULL, RSRC_CONF, TAKE2,
      "a fakename and a realname"},
! { "ScriptAlias", add_alias, CGI_MAGIC_TYPE, RSRC_CONF, TAKE2,
      "a fakename and a realname"},
  { "Redirect", add_redirect, NULL, OR_FILEINFO, TAKE2,
      "a document to be redirected, then the destination URL" },
--- 127,133 ----
  command_rec alias_cmds[] = {
  { "Alias", add_alias, NULL, RSRC_CONF, TAKE2,
      "a fakename and a realname"},
! { "ScriptAlias", add_alias, "cgi-script", Hi..

A week or so ago, I suggested (or rather, restated what I think David
Robinson said - I'm still not quite sure if this is what he meant) a
new directive, AddHandler, that would allow the user to set r->handler
(as created by my patch of a few weeks ago) based on file
extension. Following is a patch to implement this, and related
functions.

The patch both adds the directive (a trivial task), and modifies the
rest of Apache to deal with it. What it accomplishes, and what David
explicitly wanted, is the almost complete removal of "magic" media
types from Apache. Though the support is still there, so the tens of
thousands of srm.conf files still out there still work, all the
AddTypes have been depreciated and replaced with AddHandlers. For
example, instead of "AddType application/x-httpd-cgi cgi", one should
use "AddHandler cgi-script cgi". Besides semantics, what advantage
does this have?

1) It's less confusing, simply. application/x-httpd-cgi is not really
a media type, and the distinction between media types and server
actions are more clearly defined.

2) Currently, if a script does not output a Content-type header,
Apache will send "Content-type: application/x-httpd-cgi". Oops. This
is pretty much wrong. When using AddHandler, it will send text/plain,
or whatever the default type happens to be set to.

3) You can use (2) as a feature, too. For example, you could not set
Content-type on purpose, but use a file extension to do
so. This is not so useful for CGI scripts, but is very handy for asis
files (AddHandler send-as-is asis). foo.html.asis (or foo.asis.html)
clearly identifies the file as an HTML file, without having to check
the file to find out.

4) Actions can be seperated from content type, but can still have both
(instead of just one or the other). For example, "AddType
text/x-server-parsed-html shtml" means that all parsed files end up as
text/html. But if you use "AddHandler parse-file ssi", then you can
use "foo.html.ssi" or "foo.html3.ssi" or "foo.txt.ssi" or even
"foo.gif.ssi" (though don't ask me why you'd want to).

I think it's rather useful. Especially combined with the Action
command (since AddHandler's handlers can point to those added with
Action just as easily as those built into Apache), you gain a powerful
ability to more easily modify Apache's output. An example that comes
to mind might be to use an Action to pass files through the C
pre-processor. This is not limited to any one content type, but is
equally useful for all text-based ones. You can use foo.html.cpp or
foo.cpp.txt or whatnot.

Therefore I submit the following patch for review. As I said, the
command itself is relatively straightfoward, but making the rest of
Apache take advantage of it was a bit tricky. I had to make some
changes that might break something, though I think I caught
everything. For example, in order to make the Action example above
work, I needed to have internal redirects preserve content_type. I've
unset it explicitly in the situations where this is a Bad Idea (error
documents, for example), but it might cause some problems.

At any rate, I'd like some comment on this. If I don't get any by
Thursday evening (PST), I'll assume you all love it, and I'll commit
it into Apache. Thanks! Here it is:

Index: http_request.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_request.c,v
retrieving revision 1.3
diff -c -r1.3 http_request.c
*** http_request.c	1996/03/01 03:01:06	1.3
--- http_request.c	1996/03/25 06:36:06
***************
*** 563,573 ****
  	    r->no_cache = 1;	/* Do NOT send USE_LOCAL_COPY for
  				 * error documents!
  				 */
! 		/* This redirect needs to be a GET no matter what the original
! 		 * method was.
! 		 */
! 		r->method = pstrdup(r->pool, "GET");
! 		r->method_number = M_GET;
  	    internal_redirect (custom_response, r);
  	    return;
  	} else {
--- 563,575 ----
  	    r->no_cache = 1;	/* Do NOT send USE_LOCAL_COPY for
  				 * error documents!
  				 */
! 	    /* This redirect needs to be a GET no matter what the original
! 	     * method was.
! 	     */
! 	    r->method = pstrdup(r->pool, "GET");
! 	    r->method_number = M_GET;
! 	    /* One case where we don't want to preserve content-type */
! 	    r->content_type = NULL;
  	    internal_redirect (custom_response, r);
  	    return;
  	} else {
***************
*** 721,726 ****
--- 723,730 ----
      new->header_only = r->header_only;
      new->protocol = r->protocol;
      new->main = r->main;
+
+     new->content_type = r->content_type;  /* Preserve this for actions */

      new->headers_in = r->headers_in;
      new->headers_out = make_table (r->pool, 5);
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.9
diff -c -r1.9 httpd.h
*** httpd.h	1996/03/05 17:28:49	1.9
--- httpd.h	1996/03/25 06:36:09
***************
*** 252,258 ****
  #define MAP_FILE_MAGIC_TYPE "application/x-type-map"
  #define ASIS_MAGIC_TYPE "httpd/send-as-is"
  #define DIR_MAGIC_TYPE "httpd/unix-directory"
- #define PROXY_MAGIC_TYPE "httpd/proxy"

  /* Just in case your linefeed isn't the one the other end is expecting. */
  #define LF 10
--- 252,257 ----
Index: mod_actions.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_actions.c,v
retrieving revision 1.1
diff -c -r1.1 mod_actions.c
*** mod_actions.c	1996/02/22 11:46:53	1.1
--- mod_actions.c	1996/03/25 06:36:09
***************
*** 121,130 ****
  {
      action_dir_config *conf =
        (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
      char *t;

!     if (!r->content_type ||
! 	!(t = table_get(conf->action_types,  r->content_type)))
        return DECLINED;

      if (r->finfo.st_mode == 0) {
--- 121,131 ----
  {
      action_dir_config *conf =
        (action_dir_config *)get_module_config(r->per_dir_config,&action_module);
+     char *action = r->handler ? r->handler : r->content_type;
      char *t;

!     if (!action ||
! 	!(t = table_get(conf->action_types, action)))
        return DECLINED;

      if (r->finfo.st_mode == 0) {
Index: mod_alias.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_alias.c,v
retrieving revision 1.3
diff -c -r1.3 mod_alias.c
*** mod_alias.c	1996/03/05 17:28:49	1.3
--- mod_alias.c	1996/03/25 06:36:11
***************
*** 66,72 ****
  typedef struct {
      char *real;
      char *fake;
!     char *forced_type;
  } alias_entry;

  typedef struct {
--- 66,72 ----
  typedef struct {
      char *real;
      char *fake;
!     char *handler;
  } alias_entry;

  typedef struct {
***************
*** 107,113 ****

      /* XX r can NOT be relative to DocumentRoot here... compat bug. */

!     new->fake = f; new->real = r; new->forced_type = cmd->info;
      return NULL;
  }

--- 107,113 ----

      /* XX r can NOT be relative to DocumentRoot here... compat bug. */

!     new->fake = f; new->real = r; new->handler = cmd->info;
      return NULL;
  }

***************
*** 127,133 ****
  command_rec alias_cmds[] = {
  { "Alias", add_alias, NULL, RSRC_CONF, TAKE2,
      "a fakename and a realname"},
! { "ScriptAlias", add_alias, CGI_MAGIC_TYPE, RSRC_CONF, TAKE2,
      "a fakename and a realname"},
  { "Redirect", add_redirect, NULL, OR_FILEINFO, TAKE2,
      "a document to be redirected, then the destination URL" },
--- 127,133 ----
  command_rec alias_cmds[] = {
  { "Alias", add_alias, NULL, RSRC_CONF, TAKE2,
      "a fakename and a realname"},
! { "ScriptAlias", add_alias, "cgi-script", RSRC_CONF, TAKE2,
      "a fakename and a realname"},
  { "Redirect", add_redirect, NULL, OR_FILEINFO, TAKE2,
      "a document to be redirected, then the destination URL" },
***************
*** 178,186 ****
          int l = alias_matches (r->uri, p->fake);

          if (l > 0) {
! 	    if (p->forced_type)
! 		table_set (r->notes, "alias-forced-type", p->forced_type);
!
  	    if (doesc) {
  		char *escurl;
  		escurl = os_escape_path(r->pool, r->uri + l, 1);
--- 178,188 ----
          int l = alias_matches (r->uri, p->fake);

          if (l > 0) {
! 	    if (p->handler) { /* Set handler, and leave a note for mod_cgi */
! 	        r->handler = pstrdup(r->pool, p->handler);
! 		table_set (r->notes, "alias-forced-type", p->handler);
! 	    }
!
  	    if (doesc) {
  		char *escurl;
  		escurl = os_escape_path(r->pool, r->uri + l, 1);
***************
*** 238,251 ****
      return DECLINED;
  }

- int type_forced_alias (request_rec *r)
- {
-     char *t = table_get (r->notes, "alias-forced-type");
-     if (!t) return DECLINED;
-     r->content_type = t;
-     return OK;
- }
-
  module alias_module = {
     STANDARD_MODULE_STUFF,
     NULL,			/* initializer */
--- 240,245 ----
***************
*** 259,265 ****
     NULL,			/* check_user_id */
     NULL,			/* check auth */
     NULL,			/* check access */
!    type_forced_alias,		/* type_checker */
     fixup_redir,			/* fixups */
     NULL				/* logger */
  };
--- 253,259 ----
     NULL,			/* check_user_id */
     NULL,			/* check auth */
     NULL,			/* check access */
!    NULL,			/* type_checker */
     fixup_redir,			/* fixups */
     NULL				/* logger */
  };
Index: mod_asis.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_asis.c,v
retrieving revision 1.2
diff -c -r1.2 mod_asis.c
*** mod_asis.c	1996/02/22 11:46:54	1.2
--- mod_asis.c	1996/03/25 06:36:11
***************
*** 87,92 ****
--- 87,93 ----

  handler_rec asis_handlers[] = {
  { ASIS_MAGIC_TYPE, asis_handler },
+ { "send-as-is", asis_handler },
  { NULL }
  };

Index: mod_cgi.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_cgi.c,v
retrieving revision 1.5
diff -c -r1.5 mod_cgi.c
*** mod_cgi.c	1996/03/18 01:55:39	1.5
--- mod_cgi.c	1996/03/25 06:36:13
***************
*** 83,89 ****
  int is_scriptaliased (request_rec *r)
  {
      char *t = table_get (r->notes, "alias-forced-type");
!     return t && (!strcmp (t, CGI_MAGIC_TYPE));
  }

  /****************************************************************
--- 83,89 ----
  int is_scriptaliased (request_rec *r)
  {
      char *t = table_get (r->notes, "alias-forced-type");
!     return t && (!strcmp (t, "cgi-script"));
  }

  /****************************************************************
***************
*** 376,381 ****
--- 376,382 ----

  handler_rec cgi_handlers[] = {
  { CGI_MAGIC_TYPE, cgi_handler },
+ { "cgi-script", cgi_handler },
  { NULL }
  };

Index: mod_imap.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_imap.c,v
retrieving revision 1.4
diff -c -r1.4 mod_imap.c
*** mod_imap.c	1996/03/01 03:10:50	1.4
--- mod_imap.c	1996/03/25 06:36:19
***************
*** 771,776 ****
--- 771,777 ----

  handler_rec imap_handlers[] = {
  { IMAP_MAGIC_TYPE, imap_handler },
+ { "imap-file", imap_handler },
  { NULL }
  };

Index: mod_include.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_include.c,v
retrieving revision 1.5
diff -c -r1.5 mod_include.c
*** mod_include.c	1996/03/20 02:55:18	1.5
--- mod_include.c	1996/03/25 06:36:23
***************
*** 820,827 ****
  	return FORBIDDEN;
      }

-     r->content_type = "text/html";
-
      hard_timeout ("send", r);
      send_http_header(r);

--- 820,825 ----
***************
*** 852,857 ****
--- 850,861 ----
      return OK;
  }

+ int send_shtml_file (request_rec *r)
+ {
+     r->content_type = "text/html";
+     return send_parsed_file(r);
+ }
+
  int xbithack_handler (request_rec *r)
  {
      enum xbithack *state;
***************
*** 877,884 ****
  };

  handler_rec includes_handlers[] = {
! { INCLUDES_MAGIC_TYPE, send_parsed_file },
! { INCLUDES_MAGIC_TYPE3, send_parsed_file },
  { "text/html", xbithack_handler },
  { NULL }
  };
--- 881,889 ----
  };

  handler_rec includes_handlers[] = {
! { INCLUDES_MAGIC_TYPE, send_shtml_file },
! { INCLUDES_MAGIC_TYPE3, send_shtml_file },
! { "server-parsed", send_parsed_file },
  { "text/html", xbithack_handler },
  { NULL }
  };
Index: mod_mime.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_mime.c,v
retrieving revision 1.4
diff -c -r1.4 mod_mime.c
*** mod_mime.c	1996/03/23 05:16:53	1.4
--- mod_mime.c	1996/03/25 06:36:24
***************
*** 68,73 ****
--- 68,74 ----
      table *forced_types;	/* Additional AddTyped stuff */
      table *encoding_types;	/* Added with AddEncoding... */
      table *language_types;	/* Added with AddLanguage... */
+     table *handlers;		/* Added with AddHandler...  */
  } mime_dir_config;

  module mime_module;
***************
*** 80,85 ****
--- 81,87 ----
      new->forced_types = make_table (p, 4);
      new->encoding_types = make_table (p, 4);
      new->language_types = make_table (p, 4);
+     new->handlers = make_table (p, 4);

      return new;
  }
***************
*** 97,102 ****
--- 99,106 ----
  					  base->encoding_types);
      new->language_types = overlay_tables (p, add->language_types,
  					  base->language_types);
+     new->handlers = overlay_tables (p, add->handlers,
+ 					  base->handlers);

      return new;
  }
***************
*** 122,127 ****
--- 126,138 ----
      return NULL;
  }

+ char *add_handler(cmd_parms *cmd, mime_dir_config *m, char *hdlr, char *ext)
+ {
+     if (*ext == '.') ++ext;
+     table_set (m->handlers, ext, hdlr);
+     return NULL;
+ }
+
  /* The sole bit of server configuration that the MIME module has is
   * the name of its config file, so...
   */
***************
*** 140,145 ****
--- 151,158 ----
      "an encoding (e.g., gzip), followed by one or more file extensions" },
  { "AddLanguage", add_language, NULL, OR_FILEINFO, ITERATE2,
      "a language (e.g., fr), followed by one or more file extensions" },
+ { "AddHandler", add_handler, NULL, OR_FILEINFO, ITERATE2,
+     "a handler name followed by one or more file extensions" },
  { "TypesConfig", set_types_config, NULL, RSRC_CONF, TAKE1,
      "the MIME types config file" },
  { NULL }
***************
*** 217,222 ****
--- 230,240 ----
        /* Check for Content-Encoding */
        if ((type = table_get (conf->encoding_types, ext)))
  	  r->content_encoding = type;
+
+       /* Check for a special handler, but not for proxy request */
+       if ((type = table_get (conf->handlers, ext)) && !r->proxyreq)
+ 	  r->handler = type;
+
      }

      return OK;
Index: mod_negotiation.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
retrieving revision 1.2
diff -c -r1.2 mod_negotiation.c
*** mod_negotiation.c	1996/02/22 11:47:12	1.2
--- mod_negotiation.c	1996/03/25 06:36:32
***************
*** 669,675 ****
  	 * we're building...
  	 */

! 	if (!strcmp (sub_req->content_type, MAP_FILE_MAGIC_TYPE)) {
  	    closedir(dirp);

  	    neg->avail_vars->nelts = 0;
--- 669,676 ----
  	 * we're building...
  	 */

! 	if (!strcmp (sub_req->content_type, MAP_FILE_MAGIC_TYPE) ||
! 	    !strcmp (sub_req->handler, "type-map")) {
  	    closedir(dirp);

  	    neg->avail_vars->nelts = 0;
***************
*** 1117,1122 ****
--- 1118,1124 ----

  handler_rec negotiation_handlers[] = {
  { MAP_FILE_MAGIC_TYPE, handle_map_file },
+ { "type-map", handle_map_file },
  { NULL }
  };

Index: mod_proxy.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_proxy.c,v
retrieving revision 1.9
diff -c -r1.9 mod_proxy.c
*** mod_proxy.c	1996/03/22 01:05:22	1.9
--- mod_proxy.c	1996/03/25 06:36:45
***************
*** 225,230 ****
--- 225,231 ----
  	if (!conf->req) return DECLINED;

  	r->filename = pstrcat(r->pool, "proxy:", r->uri, NULL);
+ 	r->handler = "proxy-server";
  	return OK;
      } else
      {
***************
*** 702,723 ****
  }


-
- /* -------------------------------------------------------------- */
- /* Set handler */
-
-
- static int
- proxy_type(request_rec *r)
- {
-     if (strncmp(r->filename, "proxy:", 6) == 0)
-     {
- 	r->content_type = PROXY_MAGIC_TYPE;
- 	return OK;
-     } else
- 	return DECLINED;
- }
-
  /* -------------------------------------------------------------- */
  /* Invoke handler */

--- 703,708 ----
***************
*** 2664,2670 ****
  }

  static handler_rec proxy_handlers[] = {
! { PROXY_MAGIC_TYPE, proxy_handler },
  { NULL }
  };

--- 2649,2655 ----
  }

  static handler_rec proxy_handlers[] = {
! { "proxy-server", proxy_handler },
  { NULL }
  };

***************
*** 2861,2867 ****
     NULL,			/* check_user_id */
     NULL,			/* check auth */
     NULL,			/* check access */
!    proxy_type,			/* type_checker */
     proxy_fixup,			/* pre-run fixups */
     NULL				/* logger */
  };
--- 2846,2852 ----
     NULL,			/* check_user_id */
     NULL,			/* check auth */
     NULL,			/* check access */
!    NULL,			/* type_checker */
     proxy_fixup,			/* pre-run fixups */
     NULL				/* logger */
  };
Index: ../conf/srm.conf-dist
===================================================================
RCS file: /export/home/cvs/apache/conf/srm.conf-dist,v
retrieving revision 1.2
diff -c -r1.2 srm.conf-dist
*** srm.conf-dist	1996/02/22 11:45:49	1.2
--- srm.conf-dist	1996/03/25 06:37:15
***************
*** 145,185 ****
  # make certain files to be certain types.
  # Format: AddType type/subtype ext1

! #AddType text/x-server-parsed-html .shtml
! #AddType application/x-httpd-cgi .cgi
!
! # For server-side includes which will be treated as HTML3
! # for purposes of content negotiation, use
!
! #AddType text/x-server-parsed-html3 .shtml3

  # Uncomment the following line to enable Apache's send-asis HTTP file
  # feature
!
! #AddType httpd/send-as-is asis
!
! # To enable type maps, you might want to use
!
! #AddType application/x-type-map var

  # If you wish to use server-parsed imagemap files, use

! #AddType application/x-httpd-imap map

  # Action lets you define media types that will execute a script whenever
  # a matching file is called. This eliminates the need for repeated URL
  # pathnames for oft-used CGI file processors.
! # Format: Action type/subtype /cgi-script/location

! # For example, to add a footer (footer.html in your document root) to all
! # HTML files, uncomment the following:

  #Action text/html /cgi-bin/footer
-
- # If you want to do this for only files with extension ".fhtml", use
-
- #AddType httpd/footer-html fhtml
- #Action httpd/footer-html /cgi-bin/footer

  # MetaDir: specifies the name of the directory in which Apache can find
  # meta information files. These files contain additional HTTP headers
--- 145,185 ----
  # make certain files to be certain types.
  # Format: AddType type/subtype ext1

! # AddHandler allows you to map certain file extensions to "handlers",
! # actions unrelated to filetype. These can be either built into the server
! # or added with the Action command (see below)
! # Format: AddHandler action-name ext1
!
! # To use CGI scripts:
! #AddHandler cgi-script .cgi
!
! # To use server-parsed HTML files
! #AddType text/html .shtml
! #AddHandler server-parsed .shtml

  # Uncomment the following line to enable Apache's send-asis HTTP file
  # feature
! #AddHandler send-as-is asis

  # If you wish to use server-parsed imagemap files, use
+ #AddHandler imap-file map

! # To enable type maps, you might want to use
! #AddHandler type-map var

  # Action lets you define media types that will execute a script whenever
  # a matching file is called. This eliminates the need for repeated URL
  # pathnames for oft-used CGI file processors.
! # Format: Action media/type /cgi-script/location
! # Format: Action handler-name /cgi-script/location

! # For example to add a footer (footer.html in your document root) to
! # files with extension .foot (e.g. foo.html.foot), you could use:
! #AddHandler foot-action foot
! #Action foot-action /cgi-bin/footer

+ # Or to do this for all HTML files, for example, use:
  #Action text/html /cgi-bin/footer

  # MetaDir: specifies the name of the directory in which Apache can find
  # meta information files. These files contain additional HTTP headers


--

Alexei Kosut <akosut@nueva.pvt.k12.ca.us>
URL: http://www.nueva.pvt.k12.ca.us/~akosut/
Lefler on IRC, DALnet <http://www.dal.net/>

    "Right. Fair. Decent. Either the person saying them believes in
     those concepts or not. If not, then those words mean that he's
     got somebody standing behind me with a knife in his hand. And if
     he *does* beleive them, then those words mean I'm going to win."

                                - From _Xenocide_, by Orson Scott Card


Mime
View raw message