cvs commit: apache-apr/pthreads/src/main fdqueue.c http_main.c

1999-02-11 Thread rbb
rbb 99/02/11 14:15:56

  Modified:pthreads/src/main fdqueue.c http_main.c
  Log:
  Another pass at logic for signal handling.  SIGTERM works properly.  SIGHUP
  causes a zombie, and makes the socket unusable.  Graceful restarts are not
  close to working, because of signals issues with user based pthreads.  They
  are on the plate for tomorrow.
  
  Manoj and I worked on this together, both design and implementation.
  
  Revision  ChangesPath
  1.3   +2 -3  apache-apr/pthreads/src/main/fdqueue.c
  
  Index: fdqueue.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/fdqueue.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- fdqueue.c 1999/02/09 22:04:14 1.2
  +++ fdqueue.c 1999/02/11 22:15:55 1.3
  @@ -49,9 +49,8 @@
   if (pthread_mutex_lock(&queue->one_big_mutex) != 0) {
   return FD_QUEUE_FAILURE;
   }
  -while (queue->head == queue->tail) {
  -pthread_cond_wait(&queue->not_empty, &queue->one_big_mutex);
  -}
  +pthread_cond_wait(&queue->not_empty, &queue->one_big_mutex);
  +
   fd = queue->data[queue->head].fd;
   *addr = queue->data[queue->head].addr;
   /* If the queue was full, signal that it no longer is */
  
  
  
  1.17  +100 -61   apache-apr/pthreads/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_main.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- http_main.c   1999/02/11 16:33:04 1.16
  +++ http_main.c   1999/02/11 22:15:55 1.17
  @@ -175,7 +175,9 @@
   int ap_listenbacklog;
   int ap_dump_settings = 0;
   API_VAR_EXPORT int ap_extended_status = 0;
  +pthread_once_t firstcall = PTHREAD_ONCE_INIT;
   
  +
   /*
* The max child slot ever assigned, preserved across restarts.  Necessary
* to deal with MaxClients changes across SIGUSR1 restarts.  We use this
  @@ -480,15 +482,58 @@
   }
   }
   
  +void graceful_killer(void)
  +{
  +listen_rec *lr;
  +int i;
  +
  +for (i = 0; i < ap_threads_per_child; i++) {
  +pthread_cond_signal(&(csd_queue.not_empty));
  +}
  +/* Setup acceptor threads */
  +
  +lr = ap_listeners;
  +while (lr->next != NULL) {
  +close(lr->fd);
  + lr= lr->next;
  +}
  +fprintf(stderr, "gonna exit doit");
  +pthread_exit(NULL);
  +}
  +
  +static int find_child_by_pid(pid_t pid) /* ZZZ */
  +{
  +int i;
  +
  +for (i = 0; i < max_daemons_limit; ++i)
  + if (ap_scoreboard_image->parent[i].pid == pid)
  + return i;
  +
  +return -1;
  +}
  +
   /* a clean exit from a child with proper cleanup 
  static void clean_child_exit(int code) __attribute__ ((noreturn)); */
   static void clean_child_exit(int code)
   {
  +int child_num = find_child_by_pid(getpid());
  +int i;
  +listen_rec *lr;
  +
  +/*  lr = ap_listeners;
  +while (lr->next != NULL) {
  +close(lr->fd);
  + lr= lr->next;
  + }*/
  +
  +for (i = 0; i < max_threads_limit; i++)
  +ap_update_child_status(child_num, i, SERVER_DEAD, (request_rec *) 
NULL);
  +
   if (pchild) {
ap_child_exit_modules(pchild, server_conf);
ap_destroy_pool(pchild);
   }
  -/*longjump(tls()->thread_exit, 1); */
  +
   exit(code);
   }
   
  @@ -834,8 +879,6 @@
   if (child_num < 0)
return -1;
   
  -fprintf(stderr, "Updating status for %d %d to %d\n", child_num, 
thread_num, status);
  -
   ss = &ap_scoreboard_image->servers[child_num][thread_num];
   old_status = ss->status;
   ss->status = status;
  @@ -932,17 +975,6 @@
   
   }
   
  -static int find_child_by_pid(pid_t pid) /* ZZZ */
  -{
  -int i;
  -
  -for (i = 0; i < max_daemons_limit; ++i)
  - if (ap_scoreboard_image->parent[i].pid == pid)
  - return i;
  -
  -return -1;
  -}
  -
   static void reclaim_child_processes(int terminate)
   {
   int i, status;
  @@ -985,18 +1017,9 @@
case 2: /*  82ms */
break;
case 3: /* 344ms */
  - /* perhaps it missed the SIGHUP, lets try again */
  - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
  - server_conf,
  - "child process %d did not exit, sending another SIGHUP",
  - pid);
  - kill(pid, SIGHUP);
  - waittime = 1024 * 16;
  - break;
case 4: /*  16ms */
case 5: /*  82ms */
case 6: /* 344ms */
  - break;
case 7: /* 1.4sec */
/* ok, now it's being annoying */
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING,
  @@ -1266,15 +1289,12 @@
   static int volatile usr1_

cvs commit: apache-1.3/htdocs/manual handler.html

1999-02-11 Thread lars
lars99/02/11 12:23:01

  Modified:htdocs/manual handler.html
  Log:
  broken link...
  
  PR: 3867
  Submitted by: SAFRAN Philippe <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.18  +1 -1  apache-1.3/htdocs/manual/handler.html
  
  Index: handler.html
  ===
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/handler.html,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- handler.html  1998/11/20 15:56:34 1.17
  +++ handler.html  1999/02/11 20:22:59 1.18
  @@ -29,7 +29,7 @@
   handlers are unrelated to file type. This is advantageous both because
   it is a more elegant solution, but it also allows for both a type
   and a handler to be associated with a file (See also
  -Files with Multiple Extensions)
  +Files with Multiple Extensions)
   
   
   
  
  
  


cvs commit: apache-1.3 INSTALL

1999-02-11 Thread lars
lars99/02/11 11:59:52

  Modified:.INSTALL
  Log:
  typo...
  
  PR: 3878
  Submitted by: Matthew Tippett <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.53  +1 -1  apache-1.3/INSTALL
  
  Index: INSTALL
  ===
  RCS file: /export/home/cvs/apache-1.3/INSTALL,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- INSTALL   1999/01/24 22:31:47 1.52
  +++ INSTALL   1999/02/11 19:59:51 1.53
  @@ -76,7 +76,7 @@
   under all operating systems therefore you cannot use the DSO 
mechanism
   on all platforms. And Apache currently has only limited built-in
   knowledge on how to compile shared objects because this is heavily
  -platform-dependend. The current state is this:
  +platform-dependent. The current state is this:
   
   o Out-of-the-box supported platforms are:
  - Linux - SunOS - UnixWare
  
  
  


cvs commit: apache-apr/pthreads/src/main http_config.c http_core.c http_main.c

1999-02-11 Thread rbb
rbb 99/02/11 08:33:05

  Modified:pthreads/src/include http_conf_globals.h httpd.h
   pthreads/src/main http_config.c http_core.c http_main.c
  Log:
  Basic cleanup to forking logic.  Makes it more extenisble by the user.
  
  Revision  ChangesPath
  1.5   +2 -1  apache-apr/pthreads/src/include/http_conf_globals.h
  
  Index: http_conf_globals.h
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/include/http_conf_globals.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- http_conf_globals.h   1999/02/10 21:06:51 1.4
  +++ http_conf_globals.h   1999/02/11 16:33:00 1.5
  @@ -74,7 +74,8 @@
   extern gid_t group_id_list[NGROUPS_MAX];
   #endif
   extern int ap_threads_per_child;
  -extern int ap_min_idle_threads;
  +extern int ap_idle_thread_threshold;
  +extern int ap_busy_thread_threshold;
   extern int ap_max_requests_per_child;
   extern int ap_excess_requests_per_child;
   extern struct in_addr ap_bind_address;
  
  
  
  1.6   +9 -0  apache-apr/pthreads/src/include/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/include/httpd.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- httpd.h   1999/02/09 21:39:52 1.5
  +++ httpd.h   1999/02/11 16:33:00 1.6
  @@ -369,6 +369,15 @@
   #ifndef DEFAULT_THREADS_PER_CHILD
   #define DEFAULT_THREADS_PER_CHILD 50
   #endif
  +
  +#ifndef DEFAULT_IDLE_THRESHOLD
  +#define DEFAULT_IDLE_THRESHOLD (int)(DEFAULT_THREADS_PER_CHILD * 0.05)
  +#endif
  +
  +#ifndef DEFAULT_BUSY_THRESHOLD
  +#define DEFAULT_BUSY_THRESHOLD (DEFAULT_THREADS_PER_CHILD - 
(int)(DEFAULT_THREADS_PER_CHILD * 0.05))
  +#endif
  +
   #ifndef DEFAULT_EXCESS_REQUESTS_PER_CHILD
   #define DEFAULT_EXCESS_REQUESTS_PER_CHILD 0
   #endif
  
  
  
  1.7   +2 -1  apache-apr/pthreads/src/main/http_config.c
  
  Index: http_config.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_config.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- http_config.c 1999/02/10 21:06:52 1.6
  +++ http_config.c 1999/02/11 16:33:04 1.7
  @@ -1388,7 +1388,8 @@
   ap_lock_fname = DEFAULT_LOCKFILE;
   ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
   ap_threads_per_child = DEFAULT_THREADS_PER_CHILD;
  -ap_min_idle_threads = (int)(ap_threads_per_child * 0.05);
  +ap_idle_thread_threshold = DEFAULT_IDLE_THRESHOLD;
  +ap_busy_thread_threshold = DEFAULT_BUSY_THRESHOLD;
   /* ZZZ  Initialize the Network Address here. */
   ap_bind_address.s_addr = htonl(INADDR_ANY);
   ap_listeners = NULL;
  
  
  
  1.6   +36 -1 apache-apr/pthreads/src/main/http_core.c
  
  Index: http_core.c
  ===
  RCS file: /home/cvs/apache-apr/pthreads/src/main/http_core.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- http_core.c   1999/02/10 21:06:52 1.5
  +++ http_core.c   1999/02/11 16:33:04 1.6
  @@ -2149,6 +2149,27 @@
  
   return NULL;
   }
  +static const char *set_idle_threshold(cmd_parms *cmd, void *dummy, char *arg)
  +{
  +const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +if (err != NULL) {
  +return err;
  +}
  +
  +ap_idle_thread_threshold = atoi(arg);
  +return NULL;
  +}
  +
  +static const char *set_busy_threshold(cmd_parms *cmd, void *dummy, char *arg)
  +{
  +const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
  +if (err != NULL) {
  +return err;
  +}
  +
  +ap_busy_thread_threshold = atoi(arg);
  +return NULL;
  +}
   
   static const char *set_max_free_servers(cmd_parms *cmd, void *dummy, char 
*arg)
   {
  @@ -2197,13 +2218,23 @@
   }
   
   static const char *set_threads(cmd_parms *cmd, void *dummy, char *arg) {
  +int user_def_idle = ap_idle_thread_threshold;
  +int user_def_busy = ap_busy_thread_threshold;
   const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
   if (err != NULL) {
   return err;
   }
   
   ap_threads_per_child = atoi(arg);
  -ap_min_idle_threads = (int)(ap_threads_per_child * 0.05);
  +
  +ap_idle_thread_threshold = (int)(ap_threads_per_child * 0.05);
  +ap_busy_thread_threshold = ap_threads_per_child - 
(int)(ap_threads_per_child * 0.05);
  +
  +if (user_def_idle != DEFAULT_IDLE_THRESHOLD)
  +ap_idle_thread_threshold = user_def_idle;
  +if (user_def_busy != DEFAULT_BUSY_THRESHOLD)
  +ap_busy_thread_threshold = user_def_busy;
  +
   if (ap_threads_per_child < 1) {
fprintf(stderr, "WARNING: Require ThreadsPerChild > 0, setting to 1\n");
ap_threads_per_child = 1;

cvs commit: apache-1.3/src/test test_find.c test_parser.c

1999-02-11 Thread fielding
fielding99/02/11 08:24:12

  Modified:src/main util.c
   src/test test_parser.c
  Added:   src/test test_find.c
  Log:
  Replace the simple implementation of ap_find_list_item() with a
  much more efficient but complex implementation.
  
  Revision  ChangesPath
  1.152 +87 -10apache-1.3/src/main/util.c
  
  Index: util.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/util.c,v
  retrieving revision 1.151
  retrieving revision 1.152
  diff -u -r1.151 -r1.152
  --- util.c1999/02/10 13:36:50 1.151
  +++ util.c1999/02/11 16:24:09 1.152
  @@ -1132,24 +1132,101 @@
* an HTTP field value list.  Returns 1 if found, 0 if not found.
* This would be much more efficient if we stored header fields as
* an array of list items as they are received instead of a plain string.
  - * We could make it more efficient by duplicating the loop/switch above
  - * within this function, replacing the assignments with compares.
*/
   API_EXPORT(int) ap_find_list_item(pool *p, const char *line, const char *tok)
   {
  -const char *nxt;
  -char *item;
  +const unsigned char *pos;
  +const unsigned char *ptr = (const unsigned char *)line;
  +int good = 0, addspace = 0, in_qpair = 0, in_qstr = 0, in_com = 0;
   
   if (!line || !tok)
   return 0;
   
  -nxt = line;
  +do {  /* loop for each item in line's list */
   
  -while ((item = ap_get_list_item(p, &nxt)) != NULL) {
  -if (strcmp(item, tok) == 0)
  -return 1;
  -}
  -return 0;
  +/* Find first non-comma, non-whitespace byte */
  +
  +while (*ptr == ',' || ap_isspace(*ptr))
  +++ptr;
  +
  +if (*ptr)
  +good = 1;  /* until proven otherwise for this item */
  +else
  +break; /* no items left and nothing good found */
  +
  +/* We skip extra whitespace and any whitespace around a '=', '/',
  + * or ';' and lowercase normal characters not within a comment,
  + * quoted-string or quoted-pair.
  + */
  +for (pos = (const unsigned char *)tok;
  + *ptr && (in_qpair || in_qstr || in_com || *ptr != ',');
  + ++ptr) {
  +
  +if (in_qpair) {
  +in_qpair = 0;
  +if (good)
  +good = (*pos++ == *ptr);
  +}
  +else {
  +switch (*ptr) {
  +case '\\': in_qpair = 1;
  +   if (addspace == 1)
  +   good = good && (*pos++ == ' ');
  +   good = good && (*pos++ == *ptr);
  +   addspace = 0;
  +   break;
  +case '"' : if (!in_com)
  +   in_qstr = !in_qstr;
  +   if (addspace == 1)
  +   good = good && (*pos++ == ' ');
  +   good = good && (*pos++ == *ptr);
  +   addspace = 0;
  +   break;
  +case '(' : if (!in_qstr)
  +   ++in_com;
  +   if (addspace == 1)
  +   good = good && (*pos++ == ' ');
  +   good = good && (*pos++ == *ptr);
  +   addspace = 0;
  +   break;
  +case ')' : if (in_com)
  +   --in_com;
  +   good = good && (*pos++ == *ptr);
  +   addspace = 0;
  +   break;
  +case ' ' :
  +case '\t': if (addspace || !good)
  +   break;
  +   if (in_com || in_qstr)
  +   good = (*pos++ == *ptr);
  +   else
  +   addspace = 1;
  +   break;
  +case '=' :
  +case '/' :
  +case ';' : if (!(in_com || in_qstr))
  +   addspace = -1;
  +   good = good && (*pos++ == *ptr);
  +   break;
  +default  : if (!good)
  +   break;
  +   if (addspace == 1)
  +   good = (*pos++ == ' ');
  +   if (in_com || in_qstr)
  +   good = good && (*pos++ == *ptr);
  +   else
  +   good = good && (*pos++ == 
ap_tolower(*ptr));
  +   

cvs commit: apache-site/mirrors mirrors.list index.html

1999-02-11 Thread brian
brian   99/02/10 21:12:54

  Modified:mirrors  mirrors.list index.html
  Log:
  Mirror DB update.
  
  Revision  ChangesPath
  1.73  +6 -0  apache-site/mirrors/mirrors.list
  
  Index: mirrors.list
  ===
  RCS file: /home/cvs/apache-site/mirrors/mirrors.list,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- mirrors.list  1999/01/29 18:34:40 1.72
  +++ mirrors.list  1999/02/11 05:12:52 1.73
  @@ -56,6 +56,7 @@
   http jp  http://www.meisei-u.ac.jp/mirror/apache/[EMAIL 
PROTECTED]
   http kr  http://cosmos.kaist.ac.kr/packages/www/apache/  [EMAIL 
PROTECTED]
   http kr  http://www.iworld.net/apache/   [EMAIL PROTECTED]
  +http kr  http://www.apache.nobreak.com   [EMAIL PROTECTED]
   http my  http://www.cyberweb.com.my/apache/  [EMAIL PROTECTED]
   http lv  http://www.apache.pd.gov.lv/[EMAIL PROTECTED]
   http my  http://itc.kusza.edu.my/apache/ [EMAIL PROTECTED]
  @@ -106,6 +107,8 @@
   http us  http://www3.service.digital.com/apache/ [EMAIL PROTECTED]
   http us  http://apache.dreamcatchers.net/[EMAIL PROTECTED]   
Boston [UUNet]
   http us  http://galileo.galilei.com/apache/
  +http us  http://www.iodynamics.com/apache/   [EMAIL PROTECTED]
  +http us  http://apache.nextpath.com  [EMAIL PROTECTED]
   http yu  http://www.fon.bg.ac.yu/mirror/apache/  [EMAIL PROTECTED]
   http za  http://apache.is.co.za/ [EMAIL PROTECTED]
   ftp  ar  ftp://ftp.infoap.com.ar/pub/apache/dist/
  @@ -155,6 +158,7 @@
   ftp  jp  ftp://ftp.meisei-u.ac.jp/pub/www/apache/dist/
   ftp  kr  ftp://cosmos.kaist.ac.kr/packages/www/apache/dist/
   ftp  kr  ftp://ftp.nuri.net/pub/apache/dist/
  +ftp  kr  ftp://ftp.apache.nobreak.com/pub/apache/dist/
   ftp  nl  ftp://ftp.cs.uu.nl/pub/mirror/apache.org/dist/
   ftp  no  ftp://ftp.bitcon.no/pub/unix/www/servers/apache/dist/
   ftp  pl  ftp://sunsite.icm.edu.pl/pub/www/apache/dist/
  @@ -192,6 +196,8 @@
   ftp  us  ftp://www3.service.digital.com/apache/dist/
   ftp  us  ftp://galileo.galilei.com/pub/apache/
   ftp  us  ftp://ftp.mtnranch.net/pub/apache/dist/ [EMAIL PROTECTED]
  +ftp  us  ftp://ftp.iodynamics.com/pub/mirror/apache/dist/
  +ftp  us  ftp://apache.nextpath.com/pub/apache/dist/
   ftp  za  ftp://ftp.is.co.za/internet/www/servers/apache/
   ftp  za  ftp://ftpza.co.za/mirrors/apache/
   ftp  za  ftp://ftp.saix.net/pub/apache/
  
  
  
  1.61  +12 -0 apache-site/mirrors/index.html
  
  Index: index.html
  ===
  RCS file: /home/cvs/apache-site/mirrors/index.html,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- index.html1999/01/29 18:34:40 1.60
  +++ index.html1999/02/11 05:12:53 1.61
  @@ -139,6 +139,8 @@
   
   http://www.iworld.net/apache/";>kr -
   
  +http://www.apache.nobreak.com";>kr -
  +
   http://www.cyberweb.com.my/apache/";>my -
   
   http://www.apache.pd.gov.lv/";>lv -
  @@ -239,6 +241,10 @@
   
   http://galileo.galilei.com/apache/";>us -
   
  +http://www.iodynamics.com/apache/";>us -
  +
  +http://apache.nextpath.com";>us -
  +
   http://www.fon.bg.ac.yu/mirror/apache/";>yu -
   
   http://apache.is.co.za/";>za -
  @@ -342,6 +348,8 @@
   
   ftp://ftp.nuri.net/pub/apache/dist/";>kr -
   
  +ftp://ftp.apache.nobreak.com/pub/apache/dist/";>kr -
  +
   ftp://ftp.cs.uu.nl/pub/mirror/apache.org/dist/";>nl -
   
   ftp://ftp.bitcon.no/pub/unix/www/servers/apache/dist/";>no -
  @@ -416,6 +424,10 @@
   
   ftp://ftp.mtnranch.net/pub/apache/dist/";>us -
   
  +ftp://ftp.iodynamics.com/pub/mirror/apache/dist/";>us -
  +
  +ftp://apache.nextpath.com/pub/apache/dist/";>us -
  +
   ftp://ftp.is.co.za/internet/www/servers/apache/";>za -
   
   ftp://ftpza.co.za/mirrors/apache/";>za -