cvs commit: apachen/src/main http_main.c

1997-10-30 Thread dgaudet
dgaudet 97/10/30 11:13:35

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Improve the error message generated when the server is busy.
  
  PR:   1293
  Reviewed by:  Martin Kraemer, Jim Jagielski
  
  Revision  ChangesPath
  1.480 +3 -0  apachen/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.479
  retrieving revision 1.480
  diff -u -r1.479 -r1.480
  --- CHANGES   1997/10/28 06:47:25 1.479
  +++ CHANGES   1997/10/30 19:13:31 1.480
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3b3
   
  +  *) Improve the warning message generated when the server is busy.
  + [Dean Gaudet] PR#1293
  +
 *) PORT: All ports which don't otherwise define DEF_WANTHSREGEX will
get Spencer regex by default.  This is to avoid having to
discover bugs in operating system libraries.  [Dean Gaudet]
  
  
  
  1.240 +10 -5 apachen/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
  retrieving revision 1.239
  retrieving revision 1.240
  diff -u -r1.239 -r1.240
  --- http_main.c   1997/10/27 19:10:36 1.239
  +++ http_main.c   1997/10/30 19:13:34 1.240
  @@ -3002,6 +3002,7 @@
   int free_length;
   int free_slots[MAX_SPAWN_RATE];
   int last_non_dead;
  +int total_non_dead;
   
   /* initialize the free_list */
   free_length = 0;
  @@ -3009,6 +3010,7 @@
   to_kill = -1;
   idle_count = 0;
   last_non_dead = -1;
  +total_non_dead = 0;
   
   sync_scoreboard_image();
   for (i = 0; i  daemons_limit; ++i) {
  @@ -3041,6 +3043,7 @@
break;
}
if (ss-status != SERVER_DEAD) {
  + ++total_non_dead;
last_non_dead = i;
   #ifdef OPTIMIZE_TIMEOUTS
if (ss-timeout_len) {
  @@ -3086,11 +3089,13 @@
idle_spawn_rate = 1;
}
else {
  - if (idle_spawn_rate = 4) {
  - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf,
  - server seems busy, spawning %d children (you may need 
  - to increase StartServers, or Min/MaxSpareServers),
  - idle_spawn_rate);
  + if (idle_spawn_rate = 8) {
  + aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  + server seems busy, (you may need 
  + to increase StartServers, or Min/MaxSpareServers), 
  + spawning %d children, there are %d idle, and 
  + %d total children, idle_spawn_rate,
  + idle_count, total_non_dead);
}
for (i = 0; i  free_length; ++i) {
make_child(server_conf, free_slots[i], now);
  
  
  


cvs commit: apachen/src/modules/standard mod_mime_magic.c

1997-10-30 Thread dgaudet
dgaudet 97/10/30 11:20:52

  Modified:src  CHANGES
   src/modules/standard mod_mime_magic.c
  Log:
  Bug Fixes:
  
  - gzip -cdq requires at least 4k of a partial gzipped file, we
  were sending it only 1k, and it wouldn't produce any output.  But raising
  HOWMANY to 4k has implications on the performance of the (lame) ascmagic()
  code.  So ascmagic() cheats and only looks at 1k (the previous HOWMANY
  setting)
  
  - use spawn_child() interface to avoid a resource leak (zombie
  child); I don't think even worked on WIN32 before, but it might now... I
  special case and use spawnvp() on WIN32.
  
  - use pfopen()/popenf() to avoid resource leaks
  
  Cleanups:
  
  - no need to test return from palloc since it never returns NULL
  
  - ensure all log messages include the module name
  
  - Some cases were assuming that aplog_error was a never returning
  function.  Deal gracefully by propagating an error code back
  up the call chain.
  
  - remove some useless code in fsmagic() -- we don't use lstat(), we
  use stat() so the only possibility where we'll get S_IFLNK is
  if it's a broken symlink.
  
  - for various errors just DECLINE rather than cause the phase to abort
  early (a lesson we're learning from all the M_PUT changes we've
  had recently)
  
  PR:   1205
  Reviewed by:  Jim Jagielski, Martin Kraemer
  
  Revision  ChangesPath
  1.482 +5 -0  apachen/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apachen/src/CHANGES,v
  retrieving revision 1.481
  retrieving revision 1.482
  diff -u -r1.481 -r1.482
  --- CHANGES   1997/10/30 19:17:54 1.481
  +++ CHANGES   1997/10/30 19:20:48 1.482
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3b3
   
  +  *) Various mod_mime_magic bug fixes and cleanups: Uncompression
  + should work, it should work on WIN32, and a few resource
  + leaks and abort conditions are fixed.
  + [Dean Gaudet] PR#1205
  +
 *) PORT: On AIX 1.x files can't be named '@', fix the proxy cache
to use '%' instead of '@' in its encodings.
[David Schuler [EMAIL PROTECTED]] PR#1317
  
  
  
  1.19  +179 -206  apachen/src/modules/standard/mod_mime_magic.c
  
  Index: mod_mime_magic.c
  ===
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_mime_magic.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- mod_mime_magic.c  1997/10/26 21:41:11 1.18
  +++ mod_mime_magic.c  1997/10/30 19:20:51 1.19
  @@ -144,7 +144,10 @@
   
   #define MAXMIMESTRING256
   
  -#define HOWMANY 1024 /* big enough to recognize most WWW files */
  +/* HOWMANY must be at least 4096 to make gzip -dcq work */
  +#define HOWMANY  4096
  +/* SMALL_HOWMANY limits how much work we do to figure out text files */
  +#define SMALL_HOWMANY 1024
   #define MAXDESC50/* max leng of text description */
   #define MAXstring 64 /* max leng of string types */
   
  @@ -504,8 +507,8 @@
   {
   magic_server_config_rec *base = (magic_server_config_rec *) basev;
   magic_server_config_rec *add = (magic_server_config_rec *) addv;
  -magic_server_config_rec *new
  -= (magic_server_config_rec *) palloc(p, sizeof(magic_server_config_rec));
  +magic_server_config_rec *new = (magic_server_config_rec *)
  + palloc(p, sizeof(magic_server_config_rec));
   
   new-magicfile = add-magicfile ? add-magicfile : base-magicfile;
   if (add-magic  add-last) {
  @@ -565,12 +568,6 @@
   magic_req_rec *req_dat = (magic_req_rec *) palloc(r-pool,
  sizeof(magic_req_rec));
   
  -if (!req_dat) {
  - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r-server,
  - %s: memory allocation failure in magic_set_config(),
  - MODNAME);
  - return NULL;
  -}
   req_dat-head = req_dat-tail = (magic_rsl *) NULL;
   set_module_config(r-request_config, mime_magic_module, req_dat);
   return req_dat;
  @@ -587,8 +584,7 @@
   /* make sure we have a list to put it in */
   if (!req_dat) {
aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r-server,
  - %s: request config should not be NULL,
  - MODNAME);
  + MODNAME : request config should not be NULL);
if (!(req_dat = magic_set_config(r))) {
/* failure */
return -1;
  @@ -596,13 +592,7 @@
   }
   
   /* allocate the list entry */
  -if (!(rsl = (magic_rsl *) palloc(r-pool, sizeof(magic_rsl {
  - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r-server,
  - %s: memory allocation failure in magic_rsl_add(),
  - MODNAME);
  - /* failure */
  - return -1;
  -