httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject cvs commit: apache-1.3/src/main http_core.c http_main.c
Date Fri, 13 Jul 2001 07:32:59 GMT
dirkx       01/07/13 00:32:57

  Modified:    src      CHANGES
               src/include http_conf_globals.h
               src/main http_core.c http_main.c
  Log:
  Scratched an itch; it was just to painfull to move
  binaries around on FreeBSD - due to differences on
  the platform apache was compiled on and it was actually
  ran on. This adds AcceptFilter on/off to make live
  easier. Corresponding commit in doc's coming up.
  
  Revision  Changes    Path
  1.1693    +9 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1692
  retrieving revision 1.1693
  diff -u -u -r1.1692 -r1.1693
  --- CHANGES	2001/07/06 19:55:21	1.1692
  +++ CHANGES	2001/07/13 07:32:18	1.1693
  @@ -1,5 +1,14 @@
   Changes with Apache 1.3.21
   
  +  *) Added a directive: "AcceptFilter <on|off>". To control BSD 
  +     acccept filters when at compile time SO_ACCEPT_FILTER is 
  +     detected. The default is still 'on' except when AP_ACCEPT_FILTER_OFF
  +     is defined. Also downgraded the fatal exit to a warning
  +     when the associated setsocketopt() fails. This should make it
  +     easier to move httpd binaries and config files across BSD
  +     machines with varying acceptfilter support.
  +     [Dirk-Willem van Gulik <dirkx@covalent.net>]
  +
     *) Fix the <Files ~ "^\.ht"> container to *really* deny all access.
        Without the Satisfy All, .ht* files could still be fetched if
        they were within the scope of a Satisfy Any directive.
  
  
  
  1.46      +3 -0      apache-1.3/src/include/http_conf_globals.h
  
  Index: http_conf_globals.h
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/include/http_conf_globals.h,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -u -r1.45 -r1.46
  --- http_conf_globals.h	2001/01/15 17:04:31	1.45
  +++ http_conf_globals.h	2001/07/13 07:32:35	1.46
  @@ -90,6 +90,9 @@
   extern API_VAR_EXPORT int ap_daemons_limit;
   extern API_VAR_EXPORT int ap_suexec_enabled;
   extern int ap_listenbacklog;
  +#ifdef SO_ACCEPTFILTER
  +extern int ap_acceptfilter;
  +#endif
   extern int ap_dump_settings;
   extern API_VAR_EXPORT int ap_extended_status;
   
  
  
  
  1.296     +28 -0     apache-1.3/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_core.c,v
  retrieving revision 1.295
  retrieving revision 1.296
  diff -u -u -r1.295 -r1.296
  --- http_core.c	2001/03/09 10:10:25	1.295
  +++ http_core.c	2001/07/13 07:32:44	1.296
  @@ -2521,6 +2521,21 @@
   }
   #endif
   
  +/* Though the AcceptFilter functionality is not available across
  + * all platforms - we still allow the config directive to appear
  + * on all platforms and do intentionally not tie it to the compile
  + * time flag SO_ACCEPTFILTER. This makes configuration files significantly
  + * more portable; especially as an <IfModule http_core.c> or some
  + * other construct is not possible.
  + */
  +static const char *set_acceptfilter(cmd_parms *cmd, void *dummy, int flag)
  +{
  +#ifdef SO_ACCEPTFILTER
  +    ap_acceptfilter = flag;
  +#endif
  +    return NULL;
  +}
  +
   static const char *set_listener(cmd_parms *cmd, void *dummy, char *ips)
   {
       listen_rec *new;
  @@ -3159,6 +3174,19 @@
     "to die." },
   { "ListenBacklog", set_listenbacklog, NULL, RSRC_CONF, TAKE1,
     "Maximum length of the queue of pending connections, as used by listen(2)" },
  +{ "AcceptFilter", set_acceptfilter, NULL, RSRC_CONF, FLAG,
  +  "Switch AcceptFiltering on/off (default is "
  +#ifdef AP_ACCEPTFILTER_OFF
  +	"off"
  +#else
  +	"on"
  +#endif
  +	")."
  +#ifndef SO_ACCEPTFILTER
  +	"This feature is currently not compiled in; so this directive "
  +	"is ignored."
  +#endif
  +   },
   { "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, TAKE1,
     "The location of the directory Apache changes to before dumping core" },
   { "Include", include_config, NULL, (RSRC_CONF | ACCESS_CONF), TAKE1,
  
  
  
  1.543     +18 -5     apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.542
  retrieving revision 1.543
  diff -u -u -r1.542 -r1.543
  --- http_main.c	2001/06/22 12:43:54	1.542
  +++ http_main.c	2001/07/13 07:32:48	1.543
  @@ -258,6 +258,15 @@
   time_t ap_restart_time=0;
   API_VAR_EXPORT int ap_suexec_enabled = 0;
   int ap_listenbacklog;
  +#ifdef SO_ACCEPTFILTER
  +int ap_acceptfilter =
  +#ifdef AP_ACCEPTFILTER_OFF
  +	0;
  +#else
  +	1;
  +#endif
  +#endif
  +
   int ap_dump_settings = 0;
   API_VAR_EXPORT int ap_extended_status = 0;
   
  @@ -3430,7 +3439,7 @@
       }
   
   #ifdef SO_ACCEPTFILTER
  -    {
  +    if (ap_acceptfilter) {
   #ifndef ACCEPT_FILTER_NAME
   #define ACCEPT_FILTER_NAME "dataready"
   #endif
  @@ -3443,12 +3452,9 @@
   	};
   	if (setsockopt(s, SOL_SOCKET, SO_ACCEPTFILTER, &af, sizeof(af)) < 0
   	    && errno != ENOENT) {
  -	    ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf,
  +	    ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf,
   			 "make_sock: for %s, setsockopt: (SO_ACCEPTFILTER)",
   			 addr);
  -	    close(s);
  -	    ap_unblock_alarms();
  -	    exit(1);
   	}
       }
   #endif
  @@ -3745,6 +3751,13 @@
   #endif
   #ifdef SHARED_CORE
       printf(" -D SHARED_CORE\n");
  +#endif
  +#ifdef SO_ACCEPTFILTER
  +    printf(" -D SO_ACCEPTFILTER\n");
  +    printf(" -D ACCEPT_FILTER_NAME=\"" ACCEPT_FILTER_NAME "\"\n");
  +#endif
  +#ifdef AP_ACCEPTFILTER_OFF
  +    printf(" -D AP_ACCEPTFILTER_OFF\n");
   #endif
   
   /* This list displays the compiled-in default paths: */
  
  
  

Mime
View raw message