cvs commit: apache-1.3/src/main http_main.c

2000-02-05 Thread rse
rse 00/02/05 04:01:55

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Cast integer ap_wait_t values in http_main.c to get rid of compile time
  errors on platforms where "ap_wait_t" is not defined as "int" (currently
  only the NEXT and UTS21 platforms). If you've a better non-evil-cast
  solution, feel free to adjust this again.
  
  Submitted by: Gary Bickford <[EMAIL PROTECTED]>, Ralf S. Engelschall
  Reviewed by: Ralf S. Engelschall
  PR: 5053
  
  Revision  ChangesPath
  1.1508+5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1507
  retrieving revision 1.1508
  diff -u -r1.1507 -r1.1508
  --- CHANGES   2000/02/05 01:32:32 1.1507
  +++ CHANGES   2000/02/05 12:01:48 1.1508
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.12
   
  +  *) Cast integer ap_wait_t values in http_main.c to get rid of compile
  + time errors on platforms where "ap_wait_t" is not defined as "int"
  + (currently only the NEXT and UTS21 platforms).
  + [Gary Bickford <[EMAIL PROTECTED]>, Ralf S. Engelschall] PR#5053
  +
 *) The default suexec path was HTTPD_ROOT/sbin/suexec if not
configured via APACI. Changed to HTTPD_ROOT/bin/suexec.
[Lars Eilebrecht]
  
  
  
  1.491 +5 -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.490
  retrieving revision 1.491
  diff -u -r1.490 -r1.491
  --- http_main.c   2000/01/26 20:10:38 1.490
  +++ http_main.c   2000/02/05 12:01:52 1.491
  @@ -1585,7 +1585,7 @@
   for (pocr = &other_children; *pocr; pocr = &(*pocr)->next) {
if ((*pocr)->data == data) {
nocr = (*pocr)->next;
  - (*(*pocr)->maintenance) (OC_REASON_UNREGISTER, (*pocr)->data, -1);
  + (*(*pocr)->maintenance) (OC_REASON_UNREGISTER, (*pocr)->data, 
(ap_wait_t)-1);
*pocr = nocr;
/* XXX: um, well we've just wasted some space in pconf ? */
return;
  @@ -1641,7 +1641,7 @@
continue;
if (FD_ISSET(ocr->write_fd, &writable_fds))
continue;
  - (*ocr->maintenance) (OC_REASON_UNWRITABLE, ocr->data, -1);
  + (*ocr->maintenance) (OC_REASON_UNWRITABLE, ocr->data, (ap_wait_t)-1);
   }
   }
   
  @@ -2460,16 +2460,16 @@
waitret = waitpid(ocr->pid, &status, WNOHANG);
if (waitret == ocr->pid) {
ocr->pid = -1;
  - (*ocr->maintenance) (OC_REASON_DEATH, ocr->data, status);
  + (*ocr->maintenance) (OC_REASON_DEATH, ocr->data, 
(ap_wait_t)status);
}
else if (waitret == 0) {
  - (*ocr->maintenance) (OC_REASON_RESTART, ocr->data, -1);
  + (*ocr->maintenance) (OC_REASON_RESTART, ocr->data, 
(ap_wait_t)-1);
++not_dead_yet;
}
else if (waitret == -1) {
/* uh what the heck? they didn't call unregister? */
ocr->pid = -1;
  - (*ocr->maintenance) (OC_REASON_LOST, ocr->data, -1);
  + (*ocr->maintenance) (OC_REASON_LOST, ocr->data, (ap_wait_t)-1);
}
}
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

2000-01-26 Thread wsanchez
wsanchez00/01/26 12:10:45

  Modified:.STATUS
   conf httpd.conf-dist
   src/main http_main.c
  Log:
  STATUS
  
  Revision  ChangesPath
  1.801 +2 -2  apache-1.3/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/apache-1.3/STATUS,v
  retrieving revision 1.800
  retrieving revision 1.801
  diff -u -r1.800 -r1.801
  --- STATUS2000/01/26 15:38:57 1.800
  +++ STATUS2000/01/26 20:10:23 1.801
  @@ -1,5 +1,5 @@
 1.3 STATUS:
  -  Last modified at [$Date: 2000/01/26 15:38:57 $]
  +  Last modified at [$Date: 2000/01/26 20:10:23 $]
   
   Release:
   
  @@ -573,7 +573,7 @@
mips-sgi-irix6.4  no  Lars Eilebrecht
mips-siemens-reliantunix5.4   yes Martin Kraemer
OS/2  yes Brian Havard
  - powerpc-apple-rhapsody5.3 no  Wilfredo Sanchez
  + powerpc-apple-rhapsody5.6 yes Wilfredo Sanchez
rs6000-ibm-aix3.2.5   no  Sameer Parekh
rs6000-ibm-aix4.1 no  Lars Eilebrecht
rs6000-ibm-aix4.2 no  Bill Stoddard
  
  
  
  1.52  +33 -0 apache-1.3/conf/httpd.conf-dist
  
  Index: httpd.conf-dist
  ===
  RCS file: /home/cvs/apache-1.3/conf/httpd.conf-dist,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- httpd.conf-dist   1999/12/09 16:01:09 1.51
  +++ httpd.conf-dist   2000/01/26 20:10:32 1.52
  @@ -328,7 +328,9 @@
   # UserDir: The name of the directory which is appended onto a user's home
   # directory if a ~user request is received.
   #
  +
   UserDir public_html
  +
   
   #
   # Control access to UserDir directories.  The following is an example
  @@ -351,7 +353,9 @@
   # DirectoryIndex: Name of the file or files to use as a pre-written HTML
   # directory index.  Separate multiple entries with spaces.
   #
  +
   DirectoryIndex index.html
  +
   
   #
   # AccessFileName: The name of the file to look for in each directory
  @@ -397,7 +401,9 @@
   # TypesConfig describes where the mime.types file (or equivalent) is
   # to be found.
   #
  +
   TypesConfig conf/mime.types
  +
   
   #
   # DefaultType is the default MIME type the server will use for a document
  @@ -495,6 +501,9 @@
   # Aliases: Add here as many aliases as you need (with no limit). The format 
is 
   # Alias fakename realname
   #
  +
  +
  +#
   # Note that if you include a trailing / on fakename then the server will
   # require it to be present in the URL.  So "/icons" isn't aliased in this
   # example, only "/icons/"..
  @@ -529,6 +538,9 @@
   Allow from all
   
   
  +
  +# End of aliases.
  +
   #
   # Redirect allows you to tell clients about documents which used to exist in
   # your server's namespace, but do not anymore. This allows you to tell the
  @@ -539,6 +551,7 @@
   #
   # Directives controlling the display of server-generated directory listings.
   #
  +
   
   #
   # FancyIndexing is whether you want fancy directory indexing or standard
  @@ -615,6 +628,14 @@
   #
   IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
   
  +
  +# End of indexing directives.
  +
  +#
  +# Document types.
  +#
  +
  +
   #
   # AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress
   # information on the fly. Note: Not all browsers support this.
  @@ -669,7 +690,9 @@
   # Just list the languages in decreasing order of preference. We have
   # more or less alphabetized them here. You probably want to change this.
   #
  +
   LanguagePriority en da nl et fr de el it pt ltz ca es sv
  +
   
   #
   # AddType allows you to tweak mime.types without actually editing it, or to
  @@ -722,6 +745,9 @@
   #
   #AddHandler type-map var
   
  +
  +# End of document types.
  +
   #
   # Action lets you define media types that will execute a script whenever
   # a matching file is called. This eliminates the need for repeated URL
  @@ -763,6 +789,11 @@
   #  request will *not* be available to such a script.
   
   #
  +# Customize behaviour based on the browser
  +#
  +
  +
  +#
   # The following directives modify normal HTTP response behavior.
   # The first directive disables keepalive for Netscape 2.x and browsers that
   # spoof it. There are known problems with these browser implementations.
  @@ -781,6 +812,8 @@
   BrowserMatch "RealPlayer 4\.0" force-response-1.0
   BrowserMatch "Java/1\.0" force-response-1.0
   BrowserMatch "JDK/1\.0" force-response-1.0
  +
  +
   
   #
   # Allow server status reports, with the URL of 
http://servername/server-status
  
  
  
  1.490 +5 -0  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.489
  retrieving revision 1.490
  diff -u -r1.489 -r1.490
  --- http_ma

cvs commit: apache-1.3/src/main http_main.c

2000-01-12 Thread fielding
fielding00/01/11 19:38:25

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  this patch is intended to avoid a problem witnessed in apache
  installations with certain third party libraries: if there are many
  children, and then take sufficiently long to shut down, then apache's
  reclaim child processes sends the remaining children SIGKILL.  that's
  alright with me -- shutdown shouldn't take so long -- but the current code
  doesn't wait around for them to die; if they haven't all finished
  terminating right away, it sleeps for approximately 16 seconds before
  noticing that they're dead. thus, the total time required to shut down is
  generally a bit more than twenty seconds ... the last 16 seconds of which
  is quite unnecessary.
  
  anyway, what this patch does is change things so that after SIGKILL has
  been sent, the parent checks a couple of times (approx: 16ms, 84ms, 350ms,
  1.4sec) and then decides that the SIGKILL failed.  i could easily adjust
  this so that the total time spent waiting for the SIGKILL to fail is what
  it was -- 16 seconds, give or take -- but in writing this, i figured that
  if they haven't died after 1.4 seconds, then the SIGKILL wasn't
  sufficient; it's not instant, but it should never take that long.
  
  Submitted by: Ed Korthof <[EMAIL PROTECTED]>
  Reviewed by:  Roy Fielding
  
  Revision  ChangesPath
  1.1496+5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1495
  retrieving revision 1.1496
  diff -u -r1.1495 -r1.1496
  --- CHANGES   2000/01/12 01:15:20 1.1495
  +++ CHANGES   2000/01/12 03:38:14 1.1496
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.10
   
  +  *) Reduce the time that a parent waits for its children to die
  + after SIGKILL has been sent, since there isn't much point in waiting
  + another 16 seconds beyond the initial SIGTERM waiting period.
  + [Ed Korthof]
  +
 *) Revert to the 1.3.3 way of getting the server name from the
scoreboard, with a modification to make it respect the
UseCanonicalName setting. This makes things work better with
  
  
  
  1.488 +7 -2  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.487
  retrieving revision 1.488
  diff -u -r1.487 -r1.488
  --- http_main.c   2000/01/12 01:13:23 1.487
  +++ http_main.c   2000/01/12 03:38:19 1.488
  @@ -2380,7 +2380,7 @@
   
   ap_sync_scoreboard_image();
   
  -for (tries = terminate ? 4 : 1; tries <= 9; ++tries) {
  +for (tries = terminate ? 4 : 1; tries <= 12; ++tries) {
/* don't want to hold up progress any more than 
 * necessary, but we need to allow children a few moments to exit.
 * Set delay with an exponential backoff.
  @@ -2435,8 +2435,13 @@
   "child process %d still did not exit, sending a SIGKILL",
pid);
kill(pid, SIGKILL);
  + waittime = 1024 * 16; /* give them some time to die */
break;
  - case 9: /* 14 sec */
  + case 9: /*   6 sec */
  + case 10:/* 6.1 sec */
  + case 11:/* 6.4 sec */
  + break;
  + case 12:/* 7.4 sec */
/* gave it our best shot, but alas...  If this really 
 * is a child we are trying to kill and it really hasn't
 * exited, we will likely fail to bind to the port
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-12-08 Thread stoddard
stoddard99/12/08 10:51:06

  Modified:src/main http_main.c
  Log:
  I like David Whitmarsh's fix for this a bit better.
  
  Revision  ChangesPath
  1.483 +1 -1  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.482
  retrieving revision 1.483
  diff -u -r1.482 -r1.483
  --- http_main.c   1999/12/01 22:41:30 1.482
  +++ http_main.c   1999/12/08 18:51:03 1.483
  @@ -6135,7 +6135,7 @@
   pCommand = ap_psprintf(p, "\"%s\" -Z %s -f \"%s\"", buf, 
exit_event_name, ap_server_confname);  
   
   for (i = 1; i < argc; i++) {
  -pCommand = ap_psprintf(p, "%s \"%s\"",pCommand, argv[i]); 
  +pCommand = ap_pstrcat(p, pCommand, " \"", argv[i], "\"", NULL);
   }
   
   /* Create a pipe to send socket info to the child */
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-12-01 Thread stoddard
stoddard99/12/01 14:41:35

  Modified:src/main http_main.c
  Log:
  Maybe this will help eliminate some of the 'ws2_32.dll is missing' PRs.
  
  Revision  ChangesPath
  1.482 +5 -10 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.481
  retrieving revision 1.482
  diff -u -r1.481 -r1.482
  --- http_main.c   1999/11/04 19:49:40 1.481
  +++ http_main.c   1999/12/01 22:41:30 1.482
  @@ -3575,28 +3575,23 @@
return (s_iInitCount);
   
   /* s_iInitCount == 0. Do the initailization */
  -#ifdef NETWARE
   iVersionRequested = MAKEWORD(2, 0);
  -#else
  -iVersionRequested = MAKEWORD(1, 1);
  -#endif
   err = WSAStartup((WORD) iVersionRequested, &wsaData);
   if (err) {
  +printf("WSAStartup failed with error %d\n", err);
s_iInitCount = -1;
return (s_iInitCount);
   }
  -#ifdef WIN32
  -if (LOBYTE(wsaData.wVersion) != 1 ||
  - HIBYTE(wsaData.wVersion) != 1) {
  +
  +if (LOBYTE(wsaData.wVersion) != 2 ||
  + HIBYTE(wsaData.wVersion) != 0) {
  +printf("Apache requires Winsock 2. Please see the Apache FAQ for 
more information.\n");
s_iInitCount = -2;
WSACleanup();
return (s_iInitCount);
   }
  -#endif
  -
   s_iInitCount++;
   return (s_iInitCount);
  -
   }
   
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-11-04 Thread stoddard
stoddard99/11/04 11:49:43

  Modified:src/main http_main.c
  Log:
  At one time the assumption we made about InitSecurityDescriptor was true,
  but on NT 4/SP 5 this is not the case. It's safer to set the last error 
beforehand.
  Without this, net start apache & apache -k shutdown is broken.
  
  PR: 4689 4889
  Submitted by: Keith Wannamaker
  Reviewed by:  Bill Stoddard
  
  Revision  ChangesPath
  1.481 +2 -3  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.480
  retrieving revision 1.481
  diff -u -r1.480 -r1.481
  --- http_main.c   1999/10/29 07:47:57 1.480
  +++ http_main.c   1999/11/04 19:49:40 1.481
  @@ -6239,10 +6239,9 @@
   return NULL;
   }
   /*
  - * We can safely use GetLastError() here without presetting it;
  - * {Initialize,Set}SecurityDescriptor() have been verified as clearing it
  - * on successful completion.
  + * Win98 returns nonzero on failure; check LastError to make sure.
*/
  +SetLastError(0);
   if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
|| GetLastError()) {
   LocalFree( pSD );
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-10-29 Thread martin
martin  99/10/29 00:48:00

  Modified:src/main http_main.c
  Log:
  This got lost in the NETWARE commit
  
  Revision  ChangesPath
  1.480 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.479
  retrieving revision 1.480
  diff -u -r1.479 -r1.480
  --- http_main.c   1999/10/21 20:44:41 1.479
  +++ http_main.c   1999/10/29 07:47:57 1.480
  @@ -1024,7 +1024,7 @@
   #endif
   
   /* On some architectures it's safe to do unserialized accept()s in the single
  - * ' case.  But it's never safe to do it in the case where there's
  + * Listen case.  But it's never safe to do it in the case where there's
* multiple Listen statements.  Define SINGLE_LISTEN_UNSERIALIZED_ACCEPT
* when it's safe in the single Listen case.
*/
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-10-11 Thread martin
martin  99/10/11 16:08:23

  Modified:src/main http_main.c
  Log:
  Pull in httpd.h to get the prototype for ap_validate_password()
  for SHARED_CORE variants
  
  Revision  ChangesPath
  1.478 +1 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.477
  retrieving revision 1.478
  diff -u -r1.477 -r1.478
  --- http_main.c   1999/09/20 20:46:59 1.477
  +++ http_main.c   1999/10/11 23:08:19 1.478
  @@ -6623,6 +6623,7 @@
   #endif /* ndef SHARED_CORE_BOOTSTRAP */
   
   #ifndef SHARED_CORE_BOOTSTRAP
  +#include "httpd.h"
   /*
* Force ap_validate_password() into the image so that modules like
* mod_auth can use it even if they're dynamically loaded.
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-09-20 Thread manoj
manoj   99/09/20 13:34:44

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Add some compile-time flags to the output when -V is used for TPF
  
  Submitted by: David McCreedy <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.1432+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1431
  retrieving revision 1.1432
  diff -u -d -u -r1.1431 -r1.1432
  --- CHANGES   1999/09/19 21:28:35 1.1431
  +++ CHANGES   1999/09/20 20:34:30 1.1432
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.10
   
  +  *) Add some compile-time flags to the output when -V is used for TPF
  + [David McCreedy <[EMAIL PROTECTED]>]
  +
 *) mod_auth_digest fixes:
- Use unix-io instead of stdio to read /dev/random (fixes problems
  on FreeBSD)
  
  
  
  1.476 +6 -0  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.475
  retrieving revision 1.476
  diff -u -d -u -r1.475 -r1.476
  --- http_main.c   1999/09/07 20:47:23 1.475
  +++ http_main.c   1999/09/20 20:34:37 1.476
  @@ -3496,6 +3496,12 @@
   #ifdef USE_SHMGET_SCOREBOARD
   printf(" -D USE_SHMGET_SCOREBOARD\n");
   #endif
  +#ifdef USE_TPF_SCOREBOARD
  +printf(" -D USE_TPF_SCOREBOARD\n");
  +#endif
  +#ifdef USE_TPF_DAEMON
  +printf(" -D USE_TPF_DAEMON\n");
  +#endif
   #ifdef USE_OS2_SCOREBOARD
   printf(" -D USE_OS2_SCOREBOARD\n");
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-09-07 Thread stoddard
stoddard99/09/07 13:47:26

  Modified:src/main http_main.c
  Log:
  Missed a continue on the last patch. Simplified the code a bit.
  
  Revision  ChangesPath
  1.475 +15 -12apache-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.474
  retrieving revision 1.475
  diff -u -r1.474 -r1.475
  --- http_main.c   1999/09/07 20:37:20 1.474
  +++ http_main.c   1999/09/07 20:47:23 1.475
  @@ -5590,23 +5590,26 @@
   
srv = ap_select(listenmaxfd + 1, &main_fds, NULL, NULL, &tv);
   
  -if (srv == 0 || (srv == SOCKET_ERROR && h_errno == WSAEINTR)) {
  +if (srv == 0) {
   count_select_errors = 0;/* reset count of errors */  
  
   continue;
   }
else if (srv == SOCKET_ERROR) {
  -/* A "real" error occurred, log it and increment the count of
  - * select errors. This count is used to ensure we don't go into
  - * a busy loop of continuous errors.
  - */
  -ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
  - "select failed with errno %d", h_errno);
  -count_select_errors++;
  -if (count_select_errors > MAX_SELECT_ERRORS) {
  -ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 
server_conf,
  - "Too many errors in select loop. Child process 
exiting.");
  - break;
  +if (h_errno != WSAEINTR) {
  +/* A "real" error occurred, log it and increment the count of
  + * select errors. This count is used to ensure we don't go 
into
  + * a busy loop of continuous errors.
  + */
  +ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
  + "select failed with errno %d", h_errno);
  +count_select_errors++;
  +if (count_select_errors > MAX_SELECT_ERRORS) {
  +ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 
server_conf,
  + "Too many errors in select loop. Child 
process exiting.");
  +break;
  +}
   }
  +continue;
} else {
listen_rec *lr;
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-09-07 Thread stoddard
stoddard99/09/07 13:37:25

  Modified:src/main http_main.c
  Log:
  errno on WIN32 is not thread safe. Use h_errno (which resolves to 
WSAGetLastError) instead.
  
  Revision  ChangesPath
  1.474 +22 -42apache-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.473
  retrieving revision 1.474
  diff -u -r1.473 -r1.474
  --- http_main.c   1999/09/07 19:12:21 1.473
  +++ http_main.c   1999/09/07 20:37:20 1.474
  @@ -5586,40 +5586,28 @@
   
tv.tv_sec = wait_time;
tv.tv_usec = 0;
  -
memcpy(&main_fds, &listenfds, sizeof(fd_set));
  +
srv = ap_select(listenmaxfd + 1, &main_fds, NULL, NULL, &tv);
  -#ifdef WIN32
  - if (srv == SOCKET_ERROR) {
  - /* Map the Win32 error into a standard Unix error condition */
  - errno = WSAGetLastError();
  - srv = -1;
  - }
  -#endif /* WIN32 */
   
  - if (srv < 0) {
  - /* Error occurred - if EINTR, loop around with problem */
  - if (errno != EINTR) {
  - /* A "real" error occurred, log it and increment the count of
  -  * select errors. This count is used to ensure we don't go into
  -  * a busy loop of continuous errors.
  -  */
  - ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "select: 
(listen)");
  - count_select_errors++;
  - if (count_select_errors > MAX_SELECT_ERRORS) {
  - ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 
server_conf,
  - "Too many errors in select loop. Child process 
exiting.");
  - break;
  - }
  - }
  - continue;
  - }
  - count_select_errors = 0;/* reset count of errors */
  - if (srv == 0) {
  +if (srv == 0 || (srv == SOCKET_ERROR && h_errno == WSAEINTR)) {
  +count_select_errors = 0;/* reset count of errors */  
  
   continue;
  - }
  -
  - {
  +}
  + else if (srv == SOCKET_ERROR) {
  +/* A "real" error occurred, log it and increment the count of
  + * select errors. This count is used to ensure we don't go into
  + * a busy loop of continuous errors.
  + */
  +ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
  + "select failed with errno %d", h_errno);
  +count_select_errors++;
  +if (count_select_errors > MAX_SELECT_ERRORS) {
  +ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 
server_conf,
  + "Too many errors in select loop. Child process 
exiting.");
  + break;
  +}
  + } else {
listen_rec *lr;
   
lr = find_ready_listener(&main_fds);
  @@ -5630,24 +5618,16 @@
do {
clen = sizeof(sa_client);
csd = accept(sd, (struct sockaddr *) &sa_client, &clen);
  -#ifdef WIN32
if (csd == INVALID_SOCKET) {
csd = -1;
  - errno = WSAGetLastError();
}
  -#endif /* WIN32 */
  - } while (csd < 0 && errno == EINTR);
  + } while (csd < 0 && h_errno == WSAEINTR);
   
if (csd < 0) {
  -#if defined(EPROTO) && defined(ECONNABORTED)
  - if ((errno != EPROTO) && (errno != ECONNABORTED))
  -#elif defined(EPROTO)
  - if (errno != EPROTO)
  -#elif defined(ECONNABORTED)
  - if (errno != ECONNABORTED)
  -#endif
  + if (h_errno != WSAECONNABORTED) {
ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
  - "accept: (client socket)");
  + "accept: (client socket) failed with errno = 
%d",h_errno);
  +}
}
else {
add_job(csd);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-08-31 Thread stoddard
stoddard99/08/31 08:01:47

  Modified:src/main http_main.c
  Log:
  Quote all arguments on call to CreateProcess(). Problem reported on news 
group.
  
  Revision  ChangesPath
  1.472 +1 -1  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.471
  retrieving revision 1.472
  diff -u -r1.471 -r1.472
  --- http_main.c   1999/08/10 13:54:48 1.471
  +++ http_main.c   1999/08/31 15:01:45 1.472
  @@ -5815,7 +5815,7 @@
   pCommand = ap_psprintf(p, "\"%s\" -Z %s -f \"%s\"", buf, 
exit_event_name, ap_server_confname);  
   
   for (i = 1; i < argc; i++) {
  -pCommand = ap_pstrcat(p, pCommand, " ", argv[i], NULL);
  +pCommand = ap_psprintf(p, "%s \"%s\"",pCommand, argv[i]); 
   }
   
   /* Create a pipe to send socket info to the child */
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-08-10 Thread rse
rse 99/08/10 06:54:49

  Modified:src/support httpd.8
   src/main http_main.c
  Log:
  Fix the -T stuff
  
  Revision  ChangesPath
  1.15  +11 -0 apache-1.3/src/support/httpd.8
  
  Index: httpd.8
  ===
  RCS file: /home/cvs/apache-1.3/src/support/httpd.8,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- httpd.8   1999/07/13 15:19:48 1.14
  +++ httpd.8   1999/08/10 13:54:47 1.15
  @@ -92,6 +92,12 @@
   [
   .B \-S
   ] 
  +[
  +.B \-t
  +] 
  +[
  +.B \-T
  +]
   
   .SH DESCRIPTION
   .B httpd
  @@ -163,6 +169,11 @@
   Run syntax tests for configuration files only. The program immediately exits
   after these syntax parsing with either a return code of 0 (Syntax OK) or
   return code not equal to 0 (Syntax Error).
  +.TP
  +.B \-T
  +Same as option 
  +.B \-t
  +but does not check the configured document roots. 
   .TP
   .B \-X
   Run in single-process mode, for internal debugging purposes only; the daemon
  
  
  
  1.471 +3 -2  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.470
  retrieving revision 1.471
  diff -u -r1.470 -r1.471
  --- http_main.c   1999/08/09 07:54:52 1.470
  +++ http_main.c   1999/08/10 13:54:48 1.471
  @@ -1034,7 +1034,7 @@
   fprintf(stderr, "Usage: %s [-D name] [-d directory] [-f file]\n", bin);
   #endif
   fprintf(stderr, "   %s [-C \"directive\"] [-c \"directive\"]\n", 
pad);
  -fprintf(stderr, "   %s [-v] [-V] [-h] [-l] [-L] [-S] [-t]\n", pad);
  +fprintf(stderr, "   %s [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T]\n", 
pad);
   #ifdef WIN32
   fprintf(stderr, "   %s [-n service] [-k signal] [-i] [-u]\n", pad);
   #endif
  @@ -1053,7 +1053,8 @@
   fprintf(stderr, "  -l   : list compiled-in modules\n");
   fprintf(stderr, "  -L   : list available configuration 
directives\n");
   fprintf(stderr, "  -S   : show parsed settings (currently 
only vhost settings)\n");
  -fprintf(stderr, "  -t   : run syntax test for configuration 
files only\n");
  +fprintf(stderr, "  -t   : run syntax check for config files 
(with docroot check)\n");
  +fprintf(stderr, "  -T   : run syntax check for config files 
(without docroot check)\n");
   #ifdef WIN32
   fprintf(stderr, "  -n name  : set service name and use its 
ServerConfigFile\n");
   fprintf(stderr, "  -k shutdown  : tell running Apache to 
shutdown\n");
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-08-09 Thread fielding
fielding99/08/09 00:54:54

  Modified:src/main http_main.c
  Log:
  Fix last warning fix -- uid_t is long on some platforms.
  
  Revision  ChangesPath
  1.470 +3 -2  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.469
  retrieving revision 1.470
  diff -u -r1.469 -r1.470
  --- http_main.c   1999/08/08 13:31:50 1.469
  +++ http_main.c   1999/08/09 07:54:52 1.470
  @@ -3700,7 +3700,7 @@
   #endif
setuid(ap_user_id) == -1)) {
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change to uid: %d", (int) ap_user_id);
  + "setuid: unable to change to uid: %ld", (long) ap_user_id);
clean_child_exit(APEXIT_CHILDFATAL);
   }
   #endif
  @@ -4885,7 +4885,8 @@
/* Only try to switch if we're running as root */
if (!geteuid() && setuid(ap_user_id) == -1) {
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change to uid: %d", (int) 
ap_user_id);
  + "setuid: unable to change to uid: %ld",
  + (long) ap_user_id);
exit(1);
}
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-08-08 Thread dirkx
dirkx   99/08/08 06:31:51

  Modified:src/main http_main.c
  Log:
  Warning on *BSD, Solaris (uid_t <-> int) on printf.
  
  Revision  ChangesPath
  1.469 +2 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /x3/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.468
  retrieving revision 1.469
  diff -u -r1.468 -r1.469
  --- http_main.c   1999/08/08 12:05:13 1.468
  +++ http_main.c   1999/08/08 13:31:50 1.469
  @@ -3700,7 +3700,7 @@
   #endif
setuid(ap_user_id) == -1)) {
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change to uid: %d", ap_user_id);
  + "setuid: unable to change to uid: %d", (int) ap_user_id);
clean_child_exit(APEXIT_CHILDFATAL);
   }
   #endif
  @@ -4885,7 +4885,7 @@
/* Only try to switch if we're running as root */
if (!geteuid() && setuid(ap_user_id) == -1) {
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change to uid: %d", ap_user_id);
  + "setuid: unable to change to uid: %d", (int) 
ap_user_id);
exit(1);
}
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-08-08 Thread coar
coar99/08/08 05:05:15

  Modified:src/main http_main.c
  Log:
Fix a miniscule compilation warning.
  
  Revision  ChangesPath
  1.468 +1 -0  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.467
  retrieving revision 1.468
  diff -u -r1.467 -r1.468
  --- http_main.c   1999/08/05 20:04:04 1.467
  +++ http_main.c   1999/08/08 12:05:13 1.468
  @@ -6648,6 +6648,7 @@
* Force ap_validate_password() into the image so that modules like
* mod_auth can use it even if they're dynamically loaded.
*/
  +void suck_in_ap_validate_password(void);
   void suck_in_ap_validate_password(void)
   {
   ap_validate_password("a", "b");
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-08-05 Thread manoj
manoj   99/08/05 13:04:05

  Modified:src/ap   ap_sha1.c
   src/include ap_md5.h ap_sha1.h
   src/main http_main.c
  Log:
  Fix a couple of nits which also cause problems on TPF:
  
  - get rid of the "const" in a const void function definition
  - prefix BYTE and LONG with AP_ in ap_sha1.[ch]. BYTE is already defined
on TPF
  - prepend a couple of declarations with extern, so they don't end up as
double definitions.
  
  Revision  ChangesPath
  1.3   +23 -23apache-1.3/src/ap/ap_sha1.c
  
  Index: ap_sha1.c
  ===
  RCS file: /home/cvs/apache-1.3/src/ap/ap_sha1.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -d -u -r1.2 -r1.3
  --- ap_sha1.c 1999/08/02 20:50:12 1.2
  +++ ap_sha1.c 1999/08/05 20:04:01 1.3
  @@ -133,21 +133,21 @@
   temp = ROT32(A,5) + f##n(B,C,D) + E + W[i] + CONST##n;   \
   E = D; D = C; C = ROT32(B,30); B = A; A = temp
   
  -typedef unsigned char BYTE; /* an 8-bit quantity */
  -typedef unsigned long LONG; /* a 32-bit quantity */
  +typedef unsigned char AP_BYTE; /* an 8-bit quantity */
  +typedef unsigned long AP_LONG; /* a 32-bit quantity */

   #define SHA_BLOCKSIZE   64
   #define SHA_DIGESTSIZE  20

   typedef struct {
  -LONG digest[5]; /* message digest */
  -LONG count_lo, count_hi;/* 64-bit bit count */
  -LONG data[16];  /* SHA data buffer */
  +AP_LONG digest[5]; /* message digest */
  +AP_LONG count_lo, count_hi;/* 64-bit bit count */
  +AP_LONG data[16];  /* SHA data buffer */
   int local;  /* unprocessed amount in data */
   } SHA_INFO;
   
   static void sha_init(SHA_INFO *);
  -static void sha_update(SHA_INFO *, const BYTE *, int);
  +static void sha_update(SHA_INFO *, const AP_BYTE *, int);
   static void sha_final(SHA_INFO *);
   static void sha_raw_swap(SHA_INFO *);
   static void output64chunk(unsigned char, unsigned char, unsigned char,
  @@ -159,7 +159,7 @@
   static void sha_transform(SHA_INFO *sha_info)
   {
   int i;
  -LONG temp, A, B, C, D, E, W[80];
  +AP_LONG temp, A, B, C, D, E, W[80];
   
   for (i = 0; i < 16; ++i) {
W[i] = sha_info->data[i];
  @@ -231,14 +231,14 @@
   /* change endianness of data */
   
   /* count is the number of bytes to do an endian flip */
  -static void maybe_byte_reverse(LONG *buffer, int count)
  +static void maybe_byte_reverse(AP_LONG *buffer, int count)
   {
   int i;
  -BYTE ct[4], *cp;
  +AP_BYTE ct[4], *cp;
   
   if (isLittleEndian()) {/* do the swap only if it is little endian */
  - count /= sizeof(LONG);
  - cp = (BYTE *) buffer;
  + count /= sizeof(AP_LONG);
  + cp = (AP_BYTE *) buffer;
for (i = 0; i < count; ++i) {
ct[0] = cp[0];
ct[1] = cp[1];
  @@ -248,7 +248,7 @@
cp[1] = ct[2];
cp[2] = ct[1];
cp[3] = ct[0];
  - cp += sizeof(LONG);
  + cp += sizeof(AP_LONG);
}
   }
   }
  @@ -269,21 +269,21 @@
   
   /* update the SHA digest */
   
  -static void sha_update(SHA_INFO *sha_info, const BYTE *buffer, int count)
  +static void sha_update(SHA_INFO *sha_info, const AP_BYTE *buffer, int count)
   {
   int i;
   
  -if ((sha_info->count_lo + ((LONG) count << 3)) < sha_info->count_lo) {
  +if ((sha_info->count_lo + ((AP_LONG) count << 3)) < sha_info->count_lo) {
++sha_info->count_hi;
   }
  -sha_info->count_lo += (LONG) count << 3;
  -sha_info->count_hi += (LONG) count >> 29;
  +sha_info->count_lo += (AP_LONG) count << 3;
  +sha_info->count_hi += (AP_LONG) count >> 29;
   if (sha_info->local) {
i = SHA_BLOCKSIZE - sha_info->local;
if (i > count) {
i = count;
}
  - memcpy(((BYTE *) sha_info->data) + sha_info->local, buffer, i);
  + memcpy(((AP_BYTE *) sha_info->data) + sha_info->local, buffer, i);
count -= i;
buffer += i;
sha_info->local += i;
  @@ -311,20 +311,20 @@
   static void sha_final(SHA_INFO *sha_info)
   {
   int count;
  -LONG lo_bit_count, hi_bit_count;
  +AP_LONG lo_bit_count, hi_bit_count;
   
   lo_bit_count = sha_info->count_lo;
   hi_bit_count = sha_info->count_hi;
   count = (int) ((lo_bit_count >> 3) & 0x3f);
  -((BYTE *) sha_info->data)[count++] = 0x80;
  +((AP_BYTE *) sha_info->data)[count++] = 0x80;
   if (count > SHA_BLOCKSIZE - 8) {
  - memset(((BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count);
  + memset(((AP_BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count);
maybe_byte_reverse(sha_info->data, SHA_BLOCKSIZE);
sha_transform(sha_info);
  - memset((BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8);
  + memset((AP_BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8);
   }
   el

cvs commit: apache-1.3/src/main http_main.c

1999-07-28 Thread coar
coar99/07/28 11:20:56

  Modified:src  ApacheCore.def
   src/include ap_mmn.h
   src/main http_main.c
  Log:
Note some recent API changes in a couple of places; correct
docco on *SecurityDescriptor safety.
  
  Revision  ChangesPath
  1.15  +3 -0  apache-1.3/src/ApacheCore.def
  
  Index: ApacheCore.def
  ===
  RCS file: /home/cvs/apache-1.3/src/ApacheCore.def,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ApacheCore.def1999/03/12 13:54:22 1.14
  +++ ApacheCore.def1999/07/28 18:20:53 1.15
  @@ -343,4 +343,7 @@
ap_standalone   @337
ap_server_confname   @338
ap_sub_req_method_uri   @339
  + ap_field_noparam   @340
  + ap_table_merge_unique_token   @341
  + ap_table_mergen_unique_token   @342
   
  
  
  
  1.39  +2 -1  apache-1.3/src/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===
  RCS file: /home/cvs/apache-1.3/src/include/ap_mmn.h,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- ap_mmn.h  1999/06/22 15:22:14 1.38
  +++ ap_mmn.h  1999/07/28 18:20:54 1.39
  @@ -220,6 +220,7 @@
* 19990320.3   - add ap_regexec()
* 19990604.4   - add ap_field_noparam()
* 19990621.5   - add local_ip/host to conn_rec for mass-vhost
  + * 19990728.6   - add ap_table_merge[n]_unique_token
*/
   
   #define MODULE_MAGIC_COOKIE 0x41503133UL /* "AP13" */
  @@ -227,7 +228,7 @@
   #ifndef MODULE_MAGIC_NUMBER_MAJOR
   #define MODULE_MAGIC_NUMBER_MAJOR 19990320
   #endif
  -#define MODULE_MAGIC_NUMBER_MINOR 5 /* 0...n */
  +#define MODULE_MAGIC_NUMBER_MINOR 6 /* 0...n */
   #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR/* backward 
compat */
   
   /* Useful for testing for features. */
  
  
  
  1.464 +1 -1  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.463
  retrieving revision 1.464
  diff -u -r1.463 -r1.464
  --- http_main.c   1999/07/28 17:58:21 1.463
  +++ http_main.c   1999/07/28 18:20:54 1.464
  @@ -5888,7 +5888,7 @@
   }
   /*
* We can safely use GetLastError() here without presetting it;
  - * InitializeSecurityDescriptor() has been verified as clearing it
  + * {Initialize,Set}SecurityDescriptor() have been verified as clearing it
* on successful completion.
*/
   if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-28 Thread coar
coar99/07/28 10:58:24

  Modified:src/main http_main.c
  Log:
Note that *SecurityDescriptor() resets the last error if it
succeeds.
  
  Revision  ChangesPath
  1.463 +5 -0  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.462
  retrieving revision 1.463
  diff -u -r1.462 -r1.463
  --- http_main.c   1999/07/27 13:46:05 1.462
  +++ http_main.c   1999/07/28 17:58:21 1.463
  @@ -5886,6 +5886,11 @@
   if (pSD == NULL || sa == NULL) {
   return NULL;
   }
  +/*
  + * We can safely use GetLastError() here without presetting it;
  + * InitializeSecurityDescriptor() has been verified as clearing it
  + * on successful completion.
  + */
   if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
|| GetLastError()) {
   LocalFree( pSD );
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-27 Thread stoddard
stoddard99/07/27 06:46:07

  Modified:src/main http_main.c
  Log:
  Win32: Fix problem where Apache would not run if either the executable or the
  configuration file has spaces in the path. Clean up a couple of handle leaks.
  Thanks Tim!
  Obtained from: [EMAIL PROTECTED]
  Reviewed by: Bill Stoddard
  
  Revision  ChangesPath
  1.462 +5 -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.461
  retrieving revision 1.462
  diff -u -r1.461 -r1.462
  --- http_main.c   1999/07/26 09:26:07 1.461
  +++ http_main.c   1999/07/27 13:46:05 1.462
  @@ -5785,7 +5785,7 @@
   return -1;
   }
   
  -pCommand = ap_psprintf(p, "%s -Z %s -f %s", buf, exit_event_name, 
ap_server_confname);  
  +pCommand = ap_psprintf(p, "\"%s\" -Z %s -f \"%s\"", buf, 
exit_event_name, ap_server_confname);  
   
   for (i = 1; i < argc; i++) {
   pCommand = ap_pstrcat(p, pCommand, " ", argv[i], NULL);
  @@ -5807,10 +5807,6 @@
   si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
   si.wShowWindow = SW_HIDE;
   si.hStdInput   = hPipeRead;
  -/*
  -si.hStdOutput  = NULL;
  -si.hStdError   = NULL;
  -*/
   
   if (!CreateProcess(NULL, pCommand, NULL, NULL, 
  TRUE,  /* Inherit handles */
  @@ -5837,6 +5833,9 @@
   events[*processes] = kill_event;
   (*processes)++;
   
  +/* We never store the thread's handle, so close it now. */
  +CloseHandle(pi.hThread);
  +
   /* Run the chain of open sockets. For each socket, duplicate it 
* for the target process then send the WSAPROTOCOL_INFO 
* (returned by dup socket) to the child */
  @@ -5866,6 +5865,7 @@
   break;
   }
   }
  +CloseHandle(hPipeRead);
   CloseHandle(hPipeWrite);
   
   return 0;
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-26 Thread martin
martin  99/07/26 02:26:10

  Modified:src/main http_main.c
  Log:
  The "-V" switch now omits printing of the SHARED_CORE_DIR
  when the SHARED_CORE feature is not in effect.
  
  Revision  ChangesPath
  1.461 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.460
  retrieving revision 1.461
  diff -u -r1.460 -r1.461
  --- http_main.c   1999/07/23 19:52:04 1.460
  +++ http_main.c   1999/07/26 09:26:07 1.461
  @@ -3538,7 +3538,7 @@
   #ifdef SUEXEC_BIN
   printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n");
   #endif
  -#ifdef SHARED_CORE_DIR
  +#if defined(SHARED_CORE) && defined(SHARED_CORE_DIR)
   printf(" -D SHARED_CORE_DIR=\"" SHARED_CORE_DIR "\"\n");
   #endif
   #ifdef DEFAULT_PIDLOG
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-23 Thread stoddard
stoddard99/07/23 12:52:06

  Modified:src/main http_main.c
  Log:
  Win32: Add a few error messages.
  
  Revision  ChangesPath
  1.460 +5 -1  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.459
  retrieving revision 1.460
  diff -u -r1.459 -r1.460
  --- http_main.c   1999/07/23 19:33:10 1.459
  +++ http_main.c   1999/07/23 19:52:04 1.460
  @@ -5829,6 +5829,9 @@
   return -1;
   }
   else {
  +ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, server_conf,
  + "Parent: Created child process %d", pi.dwProcessId);
  +
   /* Assume the child process lives. Update the process and event 
tables */
   handles[*processes] = pi.hProcess;
   events[*processes] = kill_event;
  @@ -5840,7 +5843,8 @@
   lr = ap_listeners;
   while (lr != NULL) {
   lpWSAProtocolInfo = ap_pcalloc(p, sizeof(WSAPROTOCOL_INFO));
  -APD2("Parent: Duplicating socket %d and sending it to the child 
process.", lr->fd);
  +ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, server_conf,
  + "Parent: Duplicating socket %d and sending it to 
child process %d", lr->fd, pi.dwProcessId);
   if (WSADuplicateSocket(lr->fd, 
  pi.dwProcessId,
  lpWSAProtocolInfo) == SOCKET_ERROR) {
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-23 Thread stoddard
stoddard99/07/23 12:33:12

  Modified:src/main http_main.c
  Log:
  Exit the child process immediately upon MaxRequestPerChild being hit.
  
  Revision  ChangesPath
  1.459 +7 -26 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.458
  retrieving revision 1.459
  diff -u -r1.458 -r1.459
  --- http_main.c   1999/07/23 15:31:25 1.458
  +++ http_main.c   1999/07/23 19:33:10 1.459
  @@ -5449,8 +5449,6 @@
   int i;
   struct timeval tv;
   int wait_time = 1;
  -int start_exit = 0;
  -int start_mutex_released = 0;
   int max_jobs_per_exe;
   int max_jobs_after_exit_request;
   HANDLE hObjects[2];
  @@ -5495,7 +5493,7 @@
   rv = WaitForMultipleObjects(2, hObjects, FALSE, INFINITE);
   if (rv == WAIT_FAILED) {
ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_WIN32ERROR, server_conf,
  - "Waiting for start_mutex or exit_event -- process will exit");
  + "Waiting for start_mutex or exit_event -- process will 
exit");
   
ap_destroy_pool(pchild);
cleanup_scoreboard();
  @@ -5557,29 +,17 @@
   }
   
   while (1) {
  -#if SEVERELY_VERBOSE
  - APD4("child PID %d: thread_main total_jobs=%d start_exit=%d",
  - my_pid, total_jobs, start_exit);
  -#endif
  - if ((max_jobs_per_exe && (total_jobs > max_jobs_per_exe) && 
!start_exit)) {
  -/* When MaxRequestsPerChild is hit, handle everything on the 
stack's 
  - * listen queue before exiting. This may take a while if the 
server 
  - * is really busy.
  +if (max_jobs_per_exe && (total_jobs > max_jobs_per_exe)) {
  +/* MaxRequestsPerChild hit...
*/
  - start_exit = 1;
  - wait_time = 1;
  - ap_release_mutex(start_mutex);
  - start_mutex_released = 1;
  - APD2("process PID %d: start mutex released\n", my_pid);
  +break;
}
  -/* Always check for the exit event being signaled. Honor the exit 
event, 
  - * even if it means loosing connections in the stack's listen queue.
  +/* Always check for the exit event being signaled.
*/
   rv = WaitForSingleObject(exit_event, 0);
   ap_assert((rv == WAIT_TIMEOUT) || (rv == WAIT_OBJECT_0));
   if (rv == WAIT_OBJECT_0) {
   APD1("child: exit event signalled, exiting");
  -start_exit = 1;
   break;
   }
   
  @@ -5615,10 +5601,7 @@
}
count_select_errors = 0;/* reset count of errors */
if (srv == 0) {
  - if (start_exit)
  - break;
  - else
  - continue;
  +continue;
}
   
{
  @@ -5661,9 +5644,7 @@
   
   /* Get ready to shutdown and exit */
   allowed_globals.exit_now = 1;
  -if (!start_mutex_released) {
  - ap_release_mutex(start_mutex);
  -}
  +ap_release_mutex(start_mutex);
   
   #ifdef UNGRACEFUL_RESTART
   SetEvent(allowed_globals.thread_exit_event);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-23 Thread stoddard
stoddard99/07/23 08:31:26

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Complete apache -k restart work. Now, restarts are honored immediately without
  loosing connections in the listen queue.
  
  Revision  ChangesPath
  1.1398+10 -1 apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1397
  retrieving revision 1.1398
  diff -u -r1.1397 -r1.1398
  --- CHANGES   1999/07/19 10:15:53 1.1397
  +++ CHANGES   1999/07/23 15:31:21 1.1398
  @@ -1,5 +1,14 @@
   Changes with Apache 1.3.7
   
  +  *) Win32: More apache -k restart work. Restarts are now honored
  + immediately and connections in the listen queue are -not- lost.
  + This is made possible by the use of the WSADuplicateSocket()
  + call.  The listeners are opened in the parent, duplicated, then
  + the duplicates are passed to the child. The original listen sockets 
  + are not closed by the parent across a restart, thus the listen queue 
  + is preserved.
  + [Bill Stoddard <[EMAIL PROTECTED]>]
  +
 *) Fix handling of case when a client has sent "Expect: 100-continue"
and we are going to respond with an error, but get stuck waiting to
discard the body in the pointless hope of preserving the connection.
  @@ -70,7 +79,7 @@
could take hours.  Now, a restart is honored almost immediately. 
All connections in Apache's queues are handled but connections in 
the stack's listen queue are discarded. Restart triggered by 
  - MaxRequestPerChild is unchanged. 
  + MaxRequestPerChild is unchanged.
[Bill Stoddard <[EMAIL PROTECTED]>]
   
 *) Win32: Eliminated unnecessary call to wait_for_multiple_objects in
  
  
  
  1.458 +200 -81   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.457
  retrieving revision 1.458
  diff -u -r1.457 -r1.458
  --- http_main.c   1999/07/21 12:23:19 1.457
  +++ http_main.c   1999/07/23 15:31:25 1.458
  @@ -5363,6 +5363,71 @@
   APD2("signal prefix %s", signal_name_prefix);
   }
   
  +static void setup_inherited_listeners(pool *p)
  +{
  +HANDLE pipe;
  +listen_rec *lr;
  +int fd;
  +WSAPROTOCOL_INFO WSAProtocolInfo;
  +DWORD BytesRead;
  +
  +/* Open the pipe to the parent process to receive the inherited socket
  + * data. The sockets have been set to listening in the parent process.
  + */
  +pipe = GetStdHandle(STD_INPUT_HANDLE);
  +
  +/* Setup the listeners */
  +listenmaxfd = -1;
  +FD_ZERO(&listenfds);
  +lr = ap_listeners;
  +
  +FD_ZERO(&listenfds);
  +
  +for (;;) {
  + fd = find_listener(lr);
  + if (fd < 0) {
  +if (!ReadFile(pipe, 
  +  &WSAProtocolInfo, sizeof(WSAPROTOCOL_INFO),
  +  &BytesRead,
  +  (LPOVERLAPPED) NULL)){
  +ap_log_error(APLOG_MARK, APLOG_WIN32ERROR|APLOG_CRIT, 
server_conf,
  + "setup_inherited_listeners: Unable to read 
socket data from parent");
  +exit(1);
  +}
  +fd = WSASocket(FROM_PROTOCOL_INFO,
  +   FROM_PROTOCOL_INFO,
  +   FROM_PROTOCOL_INFO,
  +   &WSAProtocolInfo,
  +   0,
  +   0);
  +if (fd == INVALID_SOCKET) {
  +ap_log_error(APLOG_MARK, APLOG_WIN32ERROR|APLOG_CRIT, 
server_conf,
  + "setup_inherited_listeners: WSASocket failed to 
get inherit the socket.");
  +exit(1);
  +}
  +APD2("setup_inherited_listeners: WSASocket() returned socket 
%d", fd);
  + }
  + else {
  + ap_note_cleanups_for_socket(p, fd);
  + }
  + if (fd >= 0) {
  + FD_SET(fd, &listenfds);
  + if (fd > listenmaxfd)
  + listenmaxfd = fd;
  + }
  + lr->fd = fd;
  + if (lr->next == NULL)
  + break;
  + lr = lr->next;
  +}
  +/* turn the list into a ring */
  +lr->next = ap_listeners;
  +head_listener = ap_listeners;
  +close_unused_listeners();
  +CloseHandle(pipe);
  +return;
  +}
  +
   /*
* worker_main() is main loop for the child process. The loop in
* this function becomes the controlling thread for the actually working
  @@ -5443,8 +5508,13 @@
exit(0);
   }
   /* start_mutex obtained, continue into the select() loop */
  +if (one_process) {
  +setup_listeners(pconf);
  +} else {
  +/* Get listeners from the parent process */
  +setup_inherited_listeners(pconf);
  +

cvs commit: apache-1.3/src/main http_main.c

1999-07-21 Thread martin
martin  99/07/21 05:23:22

  Modified:src/main http_main.c
  Log:
  Oops! Sorry! Something killed 700 lines in
  my last commit. Here's the fixed source.
  
  Revision  ChangesPath
  1.457 +678 -1apache-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.456
  retrieving revision 1.457
  diff -u -r1.456 -r1.457
  --- http_main.c   1999/07/21 11:44:00 1.456
  +++ http_main.c   1999/07/21 12:23:19 1.457
  @@ -5841,4 +5841,681 @@
* Apache process ID. Shutdown is signaled by 'apache -k shutdown'.
*/
   signal_shutdown_event = CreateEvent(sa, TRUE, FALSE, 
signal_shutdown_name);
  -if (!signal_shutd
  \ No newline at end of file
  +if (!signal_shutdown_event) {
  + ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  + "master_main: Cannot create shutdown event %s", 
signal_shutdown_name);
  +CleanNullACL((void *)sa);
  + exit(1);
  +}
  +
  +/* Create restart event, apPID_restart, where PID is the parent 
  + * Apache process ID. Restart is signaled by 'apache -k restart'.
  + */
  +signal_restart_event = CreateEvent(sa, TRUE, FALSE, signal_restart_name);
  +if (!signal_restart_event) {
  + CloseHandle(signal_shutdown_event);
  + ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  + "master_main: Cannot create restart event %s", 
signal_restart_name);
  +CleanNullACL((void *)sa);
  + exit(1);
  +}
  +CleanNullACL((void *)sa);
  +
  +/* Create the start mutex, apPID, where PID is the parent Apache process 
ID.
  + * Ths start mutex is used during a restart to prevent more than one 
  + * child process from entering the accept loop at once.
  + */
  +start_mutex = ap_create_mutex(signal_prefix_string);
  +restart_pending = shutdown_pending = 0;
  +
  +do { /* restart-pending */
  + if (!is_graceful) {
  + ap_restart_time = time(NULL);
  + }
  + ap_clear_pool(pconf);
  + pparent = ap_make_sub_pool(pconf);
  +
  + server_conf = ap_read_config(pconf, pparent, ap_server_confname);
  + ap_clear_pool(plog);
  + ap_open_logs(server_conf, plog);
  + ap_set_version();
  + ap_init_modules(pconf, server_conf);
  + version_locked++;
  +service_set_status(SERVICE_START_PENDING);
  +/* Create child processes */
  +while (processes_to_create--) {
  +if (create_process(process_handles, process_kill_events, 
  +   ¤t_live_processes, &child_num, 
signal_prefix_string, argc, argv) < 0) {
  +ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
  + "master_main: create child process failed. 
Exiting.");
  +goto die_now;
  +}
  +}
  +service_set_status(SERVICE_RUNNING);
  + restart_pending = shutdown_pending = 0;
  +
  +/* Wait for either the shutdown or restart events to be signaled */
  +process_handles[current_live_processes] = signal_shutdown_event;
  +process_handles[current_live_processes+1] = signal_restart_event;
  +rv = WaitForMultipleObjects(current_live_processes+2, (HANDLE 
*)process_handles, 
  +FALSE, INFINITE);
  +if (rv == WAIT_FAILED) {
  +/* Something serious is wrong */
  +ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_WIN32ERROR, server_conf,
  + "WaitForMultipeObjects on process handles and 
apache-signal -- doing shutdown");
  +shutdown_pending = 1;
  +break;
  +}
  +if (rv == WAIT_TIMEOUT) {
  +/* Hey, this cannot happen */
  +ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
  + "WaitForMultipeObjects with INFINITE wait exited 
with WAIT_TIMEOUT");
  +shutdown_pending = 1;
  +}
  +
  +cld = rv - WAIT_OBJECT_0;
  +APD4("main process: wait finished, cld=%d handle %d (max=%d)", cld, 
process_handles[cld], current_live_processes);
  +if (cld == current_live_processes) {
  +/* apPID_shutdown event signalled, we should exit now */
  +shutdown_pending = 1;
  +ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, 
  + "master_main: Shutdown event signaled. Shutting the 
server down.");
  +if (ResetEvent(signal_shutdown_event) == 0) {
  +ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, 
server_conf,
  + "ResetEvent(signal_shutdown_event)");
  +}
  + /* Signal each child processes to die */
  + for (i = 0; i < current_live_processes; i++) {
  + A

cvs commit: apache-1.3/src/main http_main.c

1999-07-21 Thread martin
martin  99/07/21 04:44:02

  Modified:src/main http_main.c
  Log:
  When the network layer has been shut down, there
  is not much use in just exiting: the parent
  would simply re-create us (and we'd fail again).
  Use the CHILDFATAL code to tear the server down.
  This fixed a nasty fork-loop bug which appeared
  in these network-shutdown situations (children would
  exit and be recreated immediately).
  
  Reviewed by: Dean Gaudet
  
  Revision  ChangesPath
  1.456 +22 -678   apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.455
  retrieving revision 1.456
  diff -u -r1.455 -r1.456
  --- http_main.c   1999/07/20 17:44:16 1.455
  +++ http_main.c   1999/07/21 11:44:00 1.456
  @@ -3855,6 +3855,27 @@
case ENETUNREACH:
   #endif
   break;
  +#ifdef ENETDOWN
  + case ENETDOWN:
  +  /*
  +   * When the network layer has been shut down, there
  +   * is not much use in simply exiting: the parent
  +   * would simply re-create us (and we'd fail again).
  +   * Use the CHILDFATAL code to tear the server down.
  +   * @@@ Martin's idea for possible improvement:
  +   * A different approach would be to define
  +   * a new APEXIT_NETDOWN exit code, the reception
  +   * of which would make the parent shutdown all
  +   * children, then idle-loop until it detected that
  +   * the network is up again, and restart the children.
  +   * Ben Hyde noted that temporary ENETDOWN situations
  +   * occur in mobile IP.
  +   */
  + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + "accept: giving up.");
  + clean_child_exit(APEXIT_CHILDFATAL);
  +#endif /*ENETDOWN*/
  +
   #ifdef TPF
case EINACT:
ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  @@ -5820,681 +5841,4 @@
* Apache process ID. Shutdown is signaled by 'apache -k shutdown'.
*/
   signal_shutdown_event = CreateEvent(sa, TRUE, FALSE, 
signal_shutdown_name);
  -if (!signal_shutdown_event) {
  - ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  - "master_main: Cannot create shutdown event %s", 
signal_shutdown_name);
  -CleanNullACL((void *)sa);
  - exit(1);
  -}
  -
  -/* Create restart event, apPID_restart, where PID is the parent 
  - * Apache process ID. Restart is signaled by 'apache -k restart'.
  - */
  -signal_restart_event = CreateEvent(sa, TRUE, FALSE, signal_restart_name);
  -if (!signal_restart_event) {
  - CloseHandle(signal_shutdown_event);
  - ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  - "master_main: Cannot create restart event %s", 
signal_restart_name);
  -CleanNullACL((void *)sa);
  - exit(1);
  -}
  -CleanNullACL((void *)sa);
  -
  -/* Create the start mutex, apPID, where PID is the parent Apache process 
ID.
  - * Ths start mutex is used during a restart to prevent more than one 
  - * child process from entering the accept loop at once.
  - */
  -start_mutex = ap_create_mutex(signal_prefix_string);
  -restart_pending = shutdown_pending = 0;
  -
  -do { /* restart-pending */
  - if (!is_graceful) {
  - ap_restart_time = time(NULL);
  - }
  - ap_clear_pool(pconf);
  - pparent = ap_make_sub_pool(pconf);
  -
  - server_conf = ap_read_config(pconf, pparent, ap_server_confname);
  - ap_clear_pool(plog);
  - ap_open_logs(server_conf, plog);
  - ap_set_version();
  - ap_init_modules(pconf, server_conf);
  - version_locked++;
  -service_set_status(SERVICE_START_PENDING);
  -/* Create child processes */
  -while (processes_to_create--) {
  -if (create_process(process_handles, process_kill_events, 
  -   ¤t_live_processes, &child_num, 
signal_prefix_string, argc, argv) < 0) {
  -ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
  - "master_main: create child process failed. 
Exiting.");
  -goto die_now;
  -}
  -}
  -service_set_status(SERVICE_RUNNING);
  - restart_pending = shutdown_pending = 0;
  -
  -/* Wait for either the shutdown or restart events to be signaled */
  -process_handles[current_live_processes] = signal_shutdown_event;
  -process_handles[current_live_processes+1] = signal_restart_event;
  -rv = WaitForMultipleObjects(current_live_processes+2, (HANDLE 
*)process_

Re: cvs commit: apache-1.3/src/main http_main.c

1999-07-20 Thread Ben Laurie
[EMAIL PROTECTED] wrote:
> 
> coar99/07/20 10:44:21
> 
>   Modified:src/main http_main.c
>   Log:
> *SecurityDescriptor() should be returning an error on Win98, but
> sometimes doesn't -- so check the last error if it claims all
> went well, just in case it's fibbing.

Eeek! Things that _don't_ fail don't clear the last error in general.

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
 - Indira Gandhi


cvs commit: apache-1.3/src/main http_main.c

1999-07-20 Thread coar
coar99/07/20 10:44:21

  Modified:src/main http_main.c
  Log:
*SecurityDescriptor() should be returning an error on Win98, but
sometimes doesn't -- so check the last error if it claims all
went well, just in case it's fibbing.
  
  Submitted by: Allan Edwards <[EMAIL PROTECTED]>,
Keith Wannamaker <[EMAIL PROTECTED]>
  Reviewed by:  Ken Coar
  
  Revision  ChangesPath
  1.455 +9 -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.454
  retrieving revision 1.455
  diff -u -r1.454 -r1.455
  --- http_main.c   1999/07/02 15:55:07 1.454
  +++ http_main.c   1999/07/20 17:44:16 1.455
  @@ -5757,16 +5757,20 @@
   PSECURITY_DESCRIPTOR pSD;
   PSECURITY_ATTRIBUTES sa;
   
  -sa  = (PSECURITY_ATTRIBUTES) LocalAlloc(LPTR, sizeof 
(SECURITY_ATTRIBUTES));
  -pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, 
SECURITY_DESCRIPTOR_MIN_LENGTH);
  -if (pSD == NULL || sa == NULL)
  +sa  = (PSECURITY_ATTRIBUTES) LocalAlloc(LPTR, 
sizeof(SECURITY_ATTRIBUTES));
  +pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR,
  + SECURITY_DESCRIPTOR_MIN_LENGTH);
  +if (pSD == NULL || sa == NULL) {
   return NULL;
  -if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)) {
  +}
  +if (!InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION)
  + || GetLastError()) {
   LocalFree( pSD );
   LocalFree( sa );
   return NULL;
   }
  -if (!SetSecurityDescriptorDacl(pSD, TRUE, (PACL) NULL, FALSE)) {
  +if (!SetSecurityDescriptorDacl(pSD, TRUE, (PACL) NULL, FALSE)
  + || GetLastError()) {
   LocalFree( pSD );
   LocalFree( sa );
   return NULL;
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-07-02 Thread stoddard
stoddard99/07/02 08:55:10

  Modified:src/main http_main.c
  Log:
  Win32: More master_main cleanup.
  
  Revision  ChangesPath
  1.454 +80 -134   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.453
  retrieving revision 1.454
  diff -u -r1.453 -r1.454
  --- http_main.c   1999/06/30 03:34:36 1.453
  +++ http_main.c   1999/07/02 15:55:07 1.454
  @@ -5727,7 +5727,8 @@
   APD4("cleanup_processes: removed child in slot %d handle %d, max=%d", 
position, handle, *processes);
   }
   
  -static int create_process(HANDLE *handles, HANDLE *events, int *processes, 
int *child_num, char *kill_event_name, int argc, char **argv)
  +static int create_process(HANDLE *handles, HANDLE *events, 
  +  int *processes, int *child_num, char 
*kill_event_name, int argc, char **argv)
   {
   int i = *processes;
   HANDLE kill_event;
  @@ -5741,7 +5742,7 @@
   events[i] = kill_event;
   (*processes)++;
   
  -APD4("create_processes: created child in slot %d handle %d, max=%d", 
  +APD4("create_process: created child in slot %d handle %d, max=%d", 
(*processes)-1, handles[(*processes)-1], *processes);
   
   return 0;
  @@ -5789,8 +5790,6 @@
   /* returns NULL if invalid (Win95?) */
   PSECURITY_ATTRIBUTES sa = GetNullACL();
   int nchild = ap_daemons_to_start;
  -event **ev;
  -int *child;
   int child_num = 0;
   int rv, cld;
   char signal_prefix_string[100];
  @@ -5819,11 +5818,10 @@
   signal_shutdown_event = CreateEvent(sa, TRUE, FALSE, 
signal_shutdown_name);
   if (!signal_shutdown_event) {
ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  - "Cannot create shutdown event %s", signal_shutdown_name);
  + "master_main: Cannot create shutdown event %s", 
signal_shutdown_name);
   CleanNullACL((void *)sa);
exit(1);
   }
  -APD2("master_main: created event %s", signal_shutdown_name);
   
   /* Create restart event, apPID_restart, where PID is the parent 
* Apache process ID. Restart is signaled by 'apache -k restart'.
  @@ -5832,33 +5830,17 @@
   if (!signal_restart_event) {
CloseHandle(signal_shutdown_event);
ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  - "Cannot create restart event %s", signal_restart_name);
  + "master_main: Cannot create restart event %s", 
signal_restart_name);
   CleanNullACL((void *)sa);
exit(1);
   }
   CleanNullACL((void *)sa);
  -APD2("master_main: created event %s", signal_restart_name);
   
   /* Create the start mutex, apPID, where PID is the parent Apache process 
ID.
* Ths start mutex is used during a restart to prevent more than one 
* child process from entering the accept loop at once.
*/
   start_mutex = ap_create_mutex(signal_prefix_string);
  -ev = (event **) alloca(sizeof(event *) * nchild);
  -child = (int *) alloca(sizeof(int) * (nchild+1));
  -
  -while (processes_to_create--) {
  - service_set_status(SERVICE_START_PENDING);
  - if (create_process(process_handles, process_kill_events, 
  - ¤t_live_processes, &child_num, signal_prefix_string, argc, 
argv) < 0) {
  -ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
  - "master_main: create child process failed. 
Exiting.");
  - goto die_now;
  - }
  -}
  -
  -service_set_status(SERVICE_RUNNING);
  -
   restart_pending = shutdown_pending = 0;
   
   do { /* restart-pending */
  @@ -5874,131 +5856,95 @@
ap_set_version();
ap_init_modules(pconf, server_conf);
version_locked++;
  -
  - restart_pending = shutdown_pending = 0;
  -
  - /* Wait for either a child process to die, or for the stop_event
  -  * to be signalled by the service manager or rpc server */
  - while (1) {
  - if (current_live_processes == 0) {
  - ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO, server_conf,
  - "master_main: no child processes. Exiting.");
  +service_set_status(SERVICE_START_PENDING);
  +/* Create child processes */
  +while (processes_to_create--) {
  +if (create_process(process_handles, process_kill_events, 
  +   ¤t_live_processes, &child_num, 
signal_prefix_string, argc, argv) < 0) {
  +ap_log_error(APLOG_MARK, APLOG_ERR, server_conf,
  + "master_main: create child process failed. 
Exiting.");
   goto die_now;
  - }
  -
  - /* Next line will block forever until either a child dies, or we
  -  * get signalled on the "apache-s

cvs commit: apache-1.3/src/main http_main.c

1999-06-30 Thread jim
jim 99/06/29 20:34:38

  Modified:src/main http_main.c
  Log:
  Final phase - add to getopt string
  
  Revision  ChangesPath
  1.453 +4 -3  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.452
  retrieving revision 1.453
  diff -u -r1.452 -r1.453
  --- http_main.c   1999/06/29 15:13:12 1.452
  +++ http_main.c   1999/06/30 03:34:36 1.453
  @@ -4680,7 +4680,7 @@
   ap_setup_prelinked_modules();
   
   while ((c = getopt(argc, argv,
  - "D:C:c:xXd:f:vVlLR:Sth"
  + "D:C:c:xXd:f:vVlLR:StTh"
   #ifdef DEBUG_SIGSTOP
"Z:"
   #endif
  @@ -6175,7 +6175,7 @@
   ap_cpystrn(cwd, ap_os_canonical_filename(pcommands, cwd), sizeof(cwd));
   ap_cpystrn(ap_server_root, cwd, sizeof(ap_server_root));
   
  -while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLZ:iusSthk:n:")) != -1) {
  +while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLZ:iusStThk:n:")) != -1) {
   char **new;
switch (c) {
case 'c':
  @@ -6462,7 +6462,7 @@
* but only handle the -L option 
*/
   llp_dir = SHARED_CORE_DIR;
  -while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:SZ:th")) != -1) {
  +while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVlLR:SZ:tTh")) != -1) {
switch (c) {
case 'D':
case 'C':
  @@ -6477,6 +6477,7 @@
case 'S':
case 'Z':
case 't':
  + case 'T':
case 'h':
case '?':
break;
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-06-29 Thread rse
rse 99/06/29 07:27:43

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Fixed `httpd' usage display: -D was missing.
  PR: 4614
  
  Revision  ChangesPath
  1.1389+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1388
  retrieving revision 1.1389
  diff -u -r1.1388 -r1.1389
  --- CHANGES   1999/06/29 14:16:42 1.1388
  +++ CHANGES   1999/06/29 14:27:39 1.1389
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) Fixed `httpd' usage display: -D was missing.
  + [Ralf S. Engelschall] PR#4614
  +
 *) Fix `make r' test procedure in src/regex/: ap_isprint was not found.
[Ralf S. Engelschall] PR#4561, PR#4562
   
  
  
  
  1.451 +2 -2  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.450
  retrieving revision 1.451
  diff -u -r1.450 -r1.451
  --- http_main.c   1999/06/24 16:38:50 1.450
  +++ http_main.c   1999/06/29 14:27:42 1.451
  @@ -1028,9 +1028,9 @@
pad[i] = ' ';
   pad[i] = '\0';
   #ifdef SHARED_CORE
  -fprintf(stderr, "Usage: %s [-R directory] [-d directory] [-f file]\n", 
bin);
  +fprintf(stderr, "Usage: %s [-R directory] [-D name] [-d directory] [-f 
file]\n", bin);
   #else
  -fprintf(stderr, "Usage: %s [-d directory] [-f file]\n", bin);
  +fprintf(stderr, "Usage: %s [-D name] [-d directory] [-f file]\n", bin);
   #endif
   fprintf(stderr, "   %s [-C \"directive\"] [-c \"directive\"]\n", 
pad);
   fprintf(stderr, "   %s [-v] [-V] [-h] [-l] [-L] [-S] [-t]\n", pad);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-06-22 Thread randy
randy   99/06/22 14:55:31

  Modified:src  CHANGES Configure
   src/helpers TestCompile
  Log:
  Add support for DSO on DGUX using gcc. Tested on x86 platforms.
  
  Revision  ChangesPath
  1.1384+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1383
  retrieving revision 1.1384
  diff -u -r1.1383 -r1.1384
  --- CHANGES   1999/06/22 00:51:26 1.1383
  +++ CHANGES   1999/06/22 21:54:41 1.1384
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) Add DSO support for DGUX 4.x using gcc. Tested on x86 platforms.
  + [Randy Terbush <[EMAIL PROTECTED]>]
  + 
 *) Add the new mass-vhost module (mod_vhost_alias.c) developed and
used by Demon Internet, LTD. [Tony Finch <[EMAIL PROTECTED]>]
   
  
  
  
  1.356 +12 -3 apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.355
  retrieving revision 1.356
  diff -u -r1.355 -r1.356
  --- Configure 1999/06/18 07:53:38 1.355
  +++ Configure 1999/06/22 21:54:42 1.356
  @@ -1190,6 +1190,14 @@
SHCORE_IMPLIB='ApacheCoreOS2.a'
OS_MODULE_INCLUDE='Makefile.OS2'
;;
  + *-dgux)
  + case $CC in
  + */gcc|gcc ) CFLAGS_SHLIB="-fpic" ;;
  + esac
  + DEF_SHARED_CORE=yes
  + LDFLAGS_SHLIB="-G"
  + LDFLAGS_SHLIB_EXPORT=""
  +;;
*)
##  ok, no known explict support for shared objects
##  on this platform, but we give not up immediately.
  @@ -1358,11 +1366,12 @@
   *-dg-dgux*)
# R4.11MU02 requires -lsocket -lnsl ... no idea if it's earlier or
# later than what we already knew about.  PR#732
  - if ./helpers/TestCompile lib socket; then
  - LIBS="$LIBS -lsocket"
  - fi
if ./helpers/TestCompile lib nsl; then
LIBS="$LIBS -lnsl"
  + TLIB='-lnsl'
  + fi
  + if TLIB=$TLIB ./helpers/TestCompile lib socket; then
  + LIBS="-lsocket $LIBS"
fi
;;
   esac
  
  
  
  1.32  +1 -1  apache-1.3/src/helpers/TestCompile
  
  Index: TestCompile
  ===
  RCS file: /home/cvs/apache-1.3/src/helpers/TestCompile,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- TestCompile   1999/06/09 10:45:02 1.31
  +++ TestCompile   1999/06/22 21:54:54 1.32
  @@ -77,7 +77,7 @@
if [ "x$2" = "x" ]; then
exit
fi
  - TLIB="-l$2"
  + TLIB="-l$2 $TLIB"
if [ "x$VERBOSE" = "xyes" ]; then
ERRDIR=""
else
  
  
  

  Modified:src/main http_main.c
  Log:
  Add some more debug info.
  
  Revision  ChangesPath
  1.448 +4 -4  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.447
  retrieving revision 1.448
  diff -u -r1.447 -r1.448
  --- http_main.c   1999/06/22 00:51:30 1.447
  +++ http_main.c   1999/06/22 21:55:25 1.448
  @@ -3660,7 +3660,7 @@
if (setuid(ap_user_id) == -1) {
GETUSERMODE();
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change uid");
  + "setuid: unable to change to uid: %d", ap_user_id);
exit(1);
}
GETUSERMODE();
  @@ -3673,7 +3673,7 @@
   #endif
setuid(ap_user_id) == -1)) {
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change uid");
  + "setuid: unable to change to uid: %d", ap_user_id);
clean_child_exit(APEXIT_CHILDFATAL);
   }
   #endif
  @@ -4823,7 +4823,7 @@
if (setuid(ap_user_id) == -1) {
GETUSERMODE();
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change uid");
  + "setuid: unable to change to uid: %d", ap_user_id);
exit(1);
}
GETUSERMODE();
  @@ -4832,7 +4832,7 @@
/* Only try to switch if we're running as root */
if (!geteuid() && setuid(ap_user_id) == -1) {
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setuid: unable to change uid");
  + "setuid: unable to change to uid: %d", ap_user_id);
exit(1);
}
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-06-09 Thread stoddard
stoddard99/06/09 06:37:52

  Modified:src/main http_main.c
  Log:
  Exit after dumping vhost settings (apache -S) to be consistent with how 
Apache for Unix works.
  
  Revision  ChangesPath
  1.444 +4 -0  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.443
  retrieving revision 1.444
  diff -u -r1.443 -r1.444
  --- http_main.c   1999/06/04 04:43:45 1.443
  +++ http_main.c   1999/06/09 13:37:51 1.444
  @@ -6317,6 +6317,10 @@
   clean_parent_exit(0);
   }
   
  +if (ap_dump_settings) {
  +clean_parent_exit(0);
  +}
  +
   /* Treat -k start confpath as just -f confpath */
   if (signal_to_send && strcasecmp(signal_to_send, "start")) {
   send_signal(pconf, signal_to_send);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-06-04 Thread bjh
bjh 99/06/03 21:43:49

  Modified:src/main http_main.c
  Log:
  Code to force linking of Expat shouldn't be in the shared core loader.
  
  Revision  ChangesPath
  1.443 +1 -1  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.442
  retrieving revision 1.443
  diff -u -r1.442 -r1.443
  --- http_main.c   1999/06/02 18:26:10 1.442
  +++ http_main.c   1999/06/04 04:43:45 1.443
  @@ -6520,7 +6520,7 @@
   #endif /* ndef SHARED_CORE_BOOTSTRAP */
   
   /* force Expat to be linked into the server executable */
  -#ifdef USE_EXPAT
  +#if defined(USE_EXPAT) && !defined(SHARED_CORE_BOOTSTRAP)
   #include "xmlparse.h"
   const XML_LChar *suck_in_expat(void);
   const XML_LChar *suck_in_expat(void)
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-06-02 Thread dgaudet
dgaudet 99/06/02 11:20:40

  Modified:src/main http_main.c
  Log:
  oops I committed that SIGUSR2 change by mistake ages ago... rev 1.433
  
  Revision  ChangesPath
  1.441 +1 -2  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.440
  retrieving revision 1.441
  diff -u -r1.440 -r1.441
  --- http_main.c   1999/06/02 06:30:05 1.440
  +++ http_main.c   1999/06/02 18:20:38 1.441
  @@ -3691,7 +3691,6 @@
   #endif
   #endif
   signal(SIGALRM, alrm_handler);
  -signal(SIGUSR2, alrm_handler);
   #ifdef TPF
   signal(SIGHUP, just_die);
   signal(SIGTERM, just_die);
  @@ -4255,7 +4254,7 @@
else if (ps->last_rtime + ss->timeout_len < now) {
/* no progress, and the timeout length has been exceeded */
ss->timeout_len = 0;
  - kill(ps->pid, SIGUSR2);
  + kill(ps->pid, SIGALRM);
}
}
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-06-02 Thread dgaudet
dgaudet 99/06/01 23:30:07

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Piped error logs could cause a segfault if an error occured
  during configuration after a restart.
  
  PR:   4456
  Submitted by: Aidan Cully <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.1364+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1363
  retrieving revision 1.1364
  diff -u -r1.1363 -r1.1364
  --- CHANGES   1999/05/26 18:27:43 1.1363
  +++ CHANGES   1999/06/02 06:30:03 1.1364
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.7
   
  +  *) Piped error logs could cause a segfault if an error occured
  + during configuration after a restart.
  + [Aidan Cully <[EMAIL PROTECTED]>] PR#4456
  +
 *) If a "Location" field was stored in r->err_headers_out rather
than r->headers_out, redirect processing wouldn't find it and
the server would core dump on ap_escape_html(NULL).
  
  
  
  1.440 +13 -7 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.439
  retrieving revision 1.440
  diff -u -r1.439 -r1.440
  --- http_main.c   1999/05/25 11:49:46 1.439
  +++ http_main.c   1999/06/02 06:30:05 1.440
  @@ -333,7 +333,9 @@
   static other_child_rec *other_children;
   #endif
   
  +static pool *pglobal;/* Global pool */
   static pool *pconf;  /* Pool for config stuff */
  +static pool *plog;   /* Pool for error-logging files */
   static pool *ptrans; /* Pool for per-transaction stuff */
   static pool *pchild; /* Pool for httpd child stuff */
   static pool *pcommands;  /* Pool for -C and -c switches */
  @@ -2104,7 +2106,7 @@
   static void clean_parent_exit(int code)
   {
   /* Clear the pool - including any registered cleanups */
  -ap_destroy_pool(pconf);
  +ap_destroy_pool(pglobal);
   exit(code);
   }
   
  @@ -3579,7 +3581,9 @@
   AMCSocketInitialize();
   #endif /* WIN32 */
   
  -pconf = ap_init_alloc();
  +pglobal = ap_init_alloc();
  +pconf = ap_make_sub_pool(pglobal);
  +plog = ap_make_sub_pool(pglobal);
   ptrans = ap_make_sub_pool(pconf);
   
   ap_util_init();
  @@ -4415,7 +4419,8 @@
   
server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
setup_listeners(pconf);
  - ap_open_logs(server_conf, pconf);
  + ap_clear_pool(plog);
  + ap_open_logs(server_conf, plog);
ap_log_pid(pconf, ap_pid_fname);
ap_set_version();   /* create our server_version string */
ap_init_modules(pconf, server_conf);
  @@ -4762,7 +4767,7 @@
   
   #ifndef TPF
   if (ap_standalone) {
  - ap_open_logs(server_conf, pconf);
  + ap_open_logs(server_conf, plog);
ap_set_version();
ap_init_modules(pconf, server_conf);
version_locked++;
  @@ -4805,7 +4810,7 @@
/* Yes this is called twice. */
ap_init_modules(pconf, server_conf);
version_locked++;
  - ap_open_logs(server_conf, pconf);
  + ap_open_logs(server_conf, plog);
ap_init_modules(pconf, server_conf);
set_group_privs();
   
  @@ -5855,7 +5860,8 @@
pparent = ap_make_sub_pool(pconf);
   
server_conf = ap_read_config(pconf, pparent, ap_server_confname);
  - ap_open_logs(server_conf, pconf);
  + ap_clear_pool(plog);
  + ap_open_logs(server_conf, plog);
ap_set_version();
ap_init_modules(pconf, server_conf);
version_locked++;
  @@ -6093,7 +6099,7 @@
   ap_init_modules(pconf, server_conf);
   ap_suexec_enabled = init_suexec();
   version_locked++;
  -ap_open_logs(server_conf, pconf);
  +ap_open_logs(server_conf, plog);
   set_group_privs();
   }
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-05-25 Thread rse
rse 99/05/25 04:49:49

  Modified:src/main http_main.c
  Log:
  Give EGCS a prototype to make it happy.  Keep in mind that "static" doesn't
  work here (causes a new warning) because the stuff isn't used anywhere, of
  course.
  
  Revision  ChangesPath
  1.439 +2 -1  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.438
  retrieving revision 1.439
  diff -u -r1.438 -r1.439
  --- http_main.c   1999/05/25 10:15:06 1.438
  +++ http_main.c   1999/05/25 11:49:46 1.439
  @@ -6517,7 +6517,8 @@
   /* force Expat to be linked into the server executable */
   #ifdef USE_EXPAT
   #include "xmlparse.h"
  -const XML_LChar * suck_in_expat(void)
  +const XML_LChar *suck_in_expat(void);
  +const XML_LChar *suck_in_expat(void)
   {
   return XML_ErrorString(XML_ERROR_NONE);
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-05-25 Thread gstein
gstein  99/05/25 03:15:07

  Modified:src  Configuration.tmpl Configure Makefile.tmpl
   src/main http_main.c
  Log:
  Add RULE_EXPAT. Add src/lib/ handling.
  
  Revision  ChangesPath
  1.113 +7 -0  apache-1.3/src/Configuration.tmpl
  
  Index: Configuration.tmpl
  ===
  RCS file: /home/cvs/apache-1.3/src/Configuration.tmpl,v
  retrieving revision 1.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- Configuration.tmpl1998/12/01 23:59:53 1.112
  +++ Configuration.tmpl1999/05/25 10:15:03 1.113
  @@ -160,12 +160,19 @@
   #  is performing this function. If PARANOID is set to yes, it will
   #  actually print-out the code that the modules execute
   #
  +# EXPAT:
  +#  Include James Clark's Expat package into Apache, for use by the
  +#  modules. The "default" is to include it if the ./expat/ directory
  +#  is present. This rule will always be interpreted as "no" if the
  +#  directory is not present.
  +#
   
   Rule SOCKS4=no
   Rule SOCKS5=no
   Rule IRIXNIS=no
   Rule IRIXN32=yes
   Rule PARANOID=no
  +Rule EXPAT=default
   
   # The following rules should be set automatically by Configure. However, if
   # they are not set by Configure (because we don't know the correct value for
  
  
  
  1.349 +61 -3 apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.348
  retrieving revision 1.349
  diff -u -r1.348 -r1.349
  --- Configure 1999/05/23 16:55:28 1.348
  +++ Configure 1999/05/25 10:15:04 1.349
  @@ -77,7 +77,8 @@
   tmpfile3=$tmpfile.3
   awkfile=$tmpfile.4
   tmpconfig=$tmpfile.5
  -SUBDIRS="ap main modules"
  +SUBDIRS="ap main"
  +APLIBDIRS=""
   
   
   ## Now handle any arguments, which, for now, is -file
  @@ -223,6 +224,7 @@
   RULE_IRIXNIS=`./helpers/CutRule IRIXNIS $file`
   RULE_IRIXN32=`./helpers/CutRule IRIXN32 $file`
   RULE_PARANOID=`./helpers/CutRule PARANOID $file`
  +RULE_EXPAT=`./helpers/CutRule EXPAT $file`
   RULE_SHARED_CORE=`./helpers/CutRule SHARED_CORE $file`
   RULE_SHARED_CHAIN=`./helpers/CutRule SHARED_CHAIN $file`
   
  @@ -1565,6 +1567,27 @@
   fi
   
   
  +## Add in the Expat library if needed/wanted.
  +##
  +if [ -d ./lib/expat/ ]; then
  +if [ "$RULE_EXPAT" = "default" ]; then
  +RULE_EXPAT=yes
  +fi
  +else
  +if [ "$RULE_EXPAT" = "yes" ]; then
  +echo "ERROR: RULE_EXPAT set to \"yes\" but is not available."
  + exit 1
  +else
  +RULE_EXPAT=no
  +fi
  +fi
  +if [ "$RULE_EXPAT" = "yes" ]; then
  +EXPATLIB="lib/expat/libexpat.a"
  +APLIBDIRS="expat $APLIBDIRS"
  +CFLAGS="$CFLAGS -DUSE_EXPAT -I\$(SRCDIR)/lib/expat"
  +fi
  +
  +
   ## Now the SHARED_CHAIN stuff
   ##
   if [ "x$using_shlib" = "x1" ] ; then
  @@ -1779,7 +1802,7 @@
   
   ## Now add the target for the main Makefile
   ##
  -echo "SUBDIRS=$SUBDIRS" >> Makefile
  +echo "SUBDIRS=$SUBDIRS lib modules" >> Makefile
   echo "SUBTARGET=$SUBTARGET" >> Makefile
   echo "SHLIB_SUFFIX_NAME=$SHLIB_SUFFIX_NAME" >> Makefile
   echo "SHLIB_SUFFIX_LIST=$SHLIB_SUFFIX_LIST" >> Makefile
  @@ -1807,6 +1830,7 @@
   echo "LDFLAGS1=$LDFLAGS" >>Makefile.config
   echo "MFLAGS_STATIC=$MFLAGS_STATIC" >>Makefile.config
   echo "REGLIB=$REGLIB" >>Makefile.config
  +echo "EXPATLIB=$EXPATLIB" >>Makefile.config
   echo "RANLIB=$RANLIB" >>Makefile.config
   
   
  @@ -1991,12 +2015,46 @@
   sed -e "s#@@Configuration@@#$file#" "Makefile.tmpl" >>Makefile
   
   # xxx/Makefile
  -MAKEDIRS="support main ap regex $OSDIR"
  +MAKEDIRS="support $SUBDIRS"
   for dir in $MAKEDIRS ; do
echo Creating Makefile in $dir
./helpers/mfhead $dir $file > $dir/Makefile
$CAT Makefile.config $dir/Makefile.tmpl |\
sed -e "s:^SRCDIR=.*:SRCDIR=`./helpers/fp2rp $dir`:" >> $dir/Makefile
  +done
  +
  +
  +## Now create the lib/Makefile
  +##
  +./helpers/mfhead modules $file > lib/Makefile
  +$CAT Makefile.config | sed -e 's:^SRCDIR=.*:SRCDIR=..:' >> lib/Makefile
  +
  +$CAT << EOF >> lib/Makefile
  +APLIBS=$APLIBDIRS
  +CFLAGS=\$(OPTIM) \$(CFLAGS1) \$(EXTRA_CFLAGS)
  +
  +default: all
  +
  +all clean distclean depend :: 
  + @for i in \$(APLIBS) ""; do \\
  +   if [ "x\$\$i" != "x" ]; then \\
  + echo "===> \$(SDP)lib/\$\$i"; \\
  + (cd \$\$i && \$(MAKE) \$(MFLAGS_STATIC) SDP='\$(SDP)' 
CC='\$(CC)' AUX_CFLAGS='\$(CFLAGS)' RANLIB='\$(RANLIB)' \$@) || exit 1; \\
  +

cvs commit: apache-1.3/src/main http_main.c

1999-05-21 Thread stoddard
stoddard99/05/21 09:49:09

  Modified:src/main http_main.c
  Log:
  Win32 cleanup:
  1. Eliminate unnecessary (I hope :-) call to wait_for_multiple_objects
  2. Clean up parent process code that handles shutdown and restart signals
  3. Honor shutdown and restart events immediately, even it it means loosing 
connections in the TCP stack's listen queue. Restarts triggered by 
MaxRequestPerChild will caue the child process to handle all connections in the 
listen queue before exiting.
  PR: 3815
  
  Revision  ChangesPath
  1.437 +68 -54apache-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.436
  retrieving revision 1.437
  diff -u -r1.436 -r1.437
  --- http_main.c   1999/05/07 00:38:11 1.436
  +++ http_main.c   1999/05/21 16:49:08 1.437
  @@ -5264,7 +5264,7 @@
* we are restricted to a maximum of 64 threads.  This is a simplistic 
* routine that will increase this size.
*/
  -DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles, 
  +static DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles, 
   DWORD dwSeconds)
   {
   time_t tStopTime;
  @@ -5457,38 +5457,27 @@
my_pid, total_jobs, start_exit);
   #endif
if ((max_jobs_per_exe && (total_jobs > max_jobs_per_exe) && 
!start_exit)) {
  +/* When MaxRequestsPerChild is hit, handle everything on the 
stack's 
  + * listen queue before exiting. This may take a while if the 
server 
  + * is really busy.
  + */
start_exit = 1;
wait_time = 1;
ap_release_mutex(start_mutex);
start_mutex_released = 1;
APD2("process PID %d: start mutex released\n", my_pid);
}
  - if (!start_exit) {
  - rv = WaitForSingleObject(exit_event, 0);
  - ap_assert((rv == WAIT_TIMEOUT) || (rv == WAIT_OBJECT_0));
  - if (rv == WAIT_OBJECT_0) {
  - APD1("child: exit event signalled, exiting");
  - start_exit = 1;
  - /* Lets not break yet - we may have threads to clean up */
  - /* break;*/
  - }
  - rv = wait_for_many_objects(nthreads, child_handles, 0);
  - ap_assert(rv != WAIT_FAILED);
  - if (rv != WAIT_TIMEOUT) {
  - rv = rv - WAIT_OBJECT_0;
  - ap_assert((rv >= 0) && (rv < nthreads));
  - cleanup_thread(child_handles, &nthreads, rv);
  - break;
  - }
  - }
  +/* Always check for the exit event being signaled. Honor the exit 
event, 
  + * even if it means loosing connections in the stack's listen queue.
  + */
  +rv = WaitForSingleObject(exit_event, 0);
  +ap_assert((rv == WAIT_TIMEOUT) || (rv == WAIT_OBJECT_0));
  +if (rv == WAIT_OBJECT_0) {
  +APD1("child: exit event signalled, exiting");
  +start_exit = 1;
  +break;
  +}
   
  -#if 0
  - /* Um, this made us exit before all the connections in our
  -  * listen queue were dealt with. 
  -  */
  - if (start_exit && max_jobs_after_exit_request && (count_down-- < 0))
  - break;
  -#endif
tv.tv_sec = wait_time;
tv.tv_usec = 0;
   
  @@ -5705,7 +5694,7 @@
   
   #define MAX_PROCESSES 50 /* must be < MAX_WAIT_OBJECTS-1 */
   
  -void cleanup_process(HANDLE *handles, HANDLE *events, int position, int 
*processes)
  +static void cleanup_process(HANDLE *handles, HANDLE *events, int position, 
int *processes)
   {
   int i;
   int handle = 0;
  @@ -5724,7 +5713,7 @@
   APD4("cleanup_processes: removed child in slot %d handle %d, max=%d", 
position, handle, *processes);
   }
   
  -int create_process(HANDLE *handles, HANDLE *events, int *processes, int 
*child_num, char *kill_event_name, int argc, char **argv)
  +static int create_process(HANDLE *handles, HANDLE *events, int *processes, 
int *child_num, char *kill_event_name, int argc, char **argv)
   {
   int i = *processes;
   HANDLE kill_event;
  @@ -5810,6 +5799,9 @@
"ap%d", getpid());
   setup_signal_names(signal_prefix_string);
   
  +/* Create shutdown event, apPID_shutdown, where PID is the parent 
  + * Apache process ID. Shutdown is signaled by 'apache -k shutdown'.
  + */
   signal_shutdown_event = CreateEvent(sa, TRUE, FALSE, 
signal_shutdown_name);
   if (!signal_shutdown_event) {
ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  @@ -5818,6 +5810,10 @@
exit(1);
   }
   APD2("master_main: created event %s", signal_shutdown_name);
  +
  +/* Create restart event, apPID_restart, where PID is the parent 
  + * Apache process ID. Restart is signaled by 'apache -k restart'.
  + */
   signal_res

cvs commit: apache-1.3/src/main http_main.c

1999-05-07 Thread dgaudet
dgaudet 99/05/06 17:38:13

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  loop around on EINTR from semop()
  
  Revision  ChangesPath
  1.1352+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1351
  retrieving revision 1.1352
  diff -u -r1.1351 -r1.1352
  --- CHANGES   1999/05/07 00:16:06 1.1351
  +++ CHANGES   1999/05/07 00:38:05 1.1352
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) It's OK for a semop to return EINTR, just loop around and try
  + again.  [Dean Gaudet]
  +
 *) Fix configuration engine re-entrant hangups, which solve a
handful of problems seen with mod_perl  configuration sections
[Salvador Ortiz Garcia <[EMAIL PROTECTED]>]
  
  
  
  1.436 +10 -6 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.435
  retrieving revision 1.436
  diff -u -r1.435 -r1.436
  --- http_main.c   1999/05/05 20:42:58 1.435
  +++ http_main.c   1999/05/07 00:38:11 1.436
  @@ -741,17 +741,21 @@
   
   static void accept_mutex_on(void)
   {
  -if (semop(sem_id, &op_on, 1) < 0) {
  - perror("accept_mutex_on");
  - clean_child_exit(APEXIT_CHILDFATAL);
  +while (semop(sem_id, &op_on, 1) < 0) {
  + if (errno != EINTR) {
  + perror("accept_mutex_on");
  + clean_child_exit(APEXIT_CHILDFATAL);
  + }
   }
   }
   
   static void accept_mutex_off(void)
   {
  -if (semop(sem_id, &op_off, 1) < 0) {
  - perror("accept_mutex_off");
  - clean_child_exit(APEXIT_CHILDFATAL);
  +while (semop(sem_id, &op_off, 1) < 0) {
  + if (errno != EINTR) {
  + perror("accept_mutex_off");
  + clean_child_exit(APEXIT_CHILDFATAL);
  + }
   }
   }
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-05-05 Thread coar
coar99/05/05 13:43:02

  Modified:src  CHANGES
   src/main http_main.c
  Log:
Fix the grouplist problem caused by setgid() on some systems.
  
  PR:   2579
  Submitted by: Rob Saccoccio <[EMAIL PROTECTED]>
  Reviewed by:  Ken Coar
  
  Revision  ChangesPath
  1.1349+5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1348
  retrieving revision 1.1349
  diff -u -r1.1348 -r1.1349
  --- CHANGES   1999/05/05 20:18:04 1.1348
  +++ CHANGES   1999/05/05 20:42:55 1.1349
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.7
   
  +  *) Do setgid() before initgroups() in http_main; some platforms
  + zap the grouplist when setgid() is called.  This was fixed in
  + suexec earlier, but the main httpd code missed the change.
  + [Rob Saccoccio <[EMAIL PROTECTED]>]  PR#2579
  +
 *) Add recognition of .tgz as a gzipped tarchive.
[Bertrand de Singly <[EMAIL PROTECTED]>]  PR#2364
   
  
  
  
  1.435 +13 -8 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.434
  retrieving revision 1.435
  diff -u -r1.434 -r1.435
  --- http_main.c   1999/05/04 11:21:10 1.434
  +++ http_main.c   1999/05/05 20:42:58 1.435
  @@ -2993,6 +2993,17 @@
   #if !defined(OS2) && !defined(TPF)
/* OS/2 and TPF don't support groups. */
   
  + /*
  +  * Set the GID before initgroups(), since on some platforms
  +  * setgid() is known to zap the group list.
  +  */
  + if (setgid(ap_group_id) == -1) {
  + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  + "setgid: unable to set group id to Group %u",
  + (unsigned)ap_group_id);
  + clean_child_exit(APEXIT_CHILDFATAL);
  + }
  +
/* Reset `groups' attributes. */
   
if (initgroups(name, ap_group_id) == -1) {
  @@ -3006,15 +3017,9 @@
ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
"getgroups: unable to get group list");
clean_child_exit(APEXIT_CHILDFATAL);
  - }
  -#endif
  - if (setgid(ap_group_id) == -1) {
  - ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  - "setgid: unable to set group id to Group %u",
  - (unsigned)ap_group_id);
  - clean_child_exit(APEXIT_CHILDFATAL);
}
  -#endif
  +#endif /* MULTIPLE_GROUPS */
  +#endif /* !defined(OS2) && !defined(TPF) */
   }
   #endif /* ndef WIN32 */
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-04-21 Thread rse
rse 99/04/21 11:08:07

  Modified:src/main http_main.c
  Log:
  Fix a recently introduced warning:
  
  | :> make
  | gcc -c  -I../os/unix -I../include   -funsigned-char -DTARGET=\"apache\" 
-pipe
  | -O -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-align 
-Wmissing-prototypes
  | -Wmissing-declarations -Wnested-externs -Winline `../apaci` http_main.c
  | http_main.c:3485: warning: no previous prototype for `common_init'
  
  I've checked it and it looks like a mistake from a recent commit, because
  commot_init() is still a locally used function only:
  
  | :> aps grep common_init
  | ===> main/http_main.c
  | static void common_init(void)
  | common_init();
  | common_init();
  | common_init();
  
  Feel free to complain and reverse this again, but then please fix it in
  addition to a prototype somewhere in the header files or at least at the start
  of http_main.c, of course.
  
  Revision  ChangesPath
  1.431 +1 -1  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.430
  retrieving revision 1.431
  diff -u -r1.430 -r1.431
  --- http_main.c   1999/04/20 19:15:39 1.430
  +++ http_main.c   1999/04/21 18:08:05 1.431
  @@ -3481,7 +3481,7 @@
* some of it is #ifdef'd but was duplicated before anyhow.  This stuff
* is still a mess.
*/
  -void common_init(void)
  +static void common_init(void)
   {
   INIT_SIGLIST()
   #ifdef AUX3
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1999-04-20 Thread dgaudet
dgaudet 99/04/20 12:15:46

  Modified:src  CHANGES
   src/main http_main.c http_protocol.c
  Log:
  r->request_time wasn't being set in certain error cases
  
  PR:   4156
  
  Revision  ChangesPath
  1.1313+3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1312
  retrieving revision 1.1313
  diff -u -r1.1312 -r1.1313
  --- CHANGES   1999/04/20 18:36:01 1.1312
  +++ CHANGES   1999/04/20 19:15:34 1.1313
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.7
   
  +  *) r->request_time wasn't being set properly in certain error conditions.
  + [Dean Gaudet] PR#4156
  +
 *) PORT: deal with UTS compiler error in http_protocol.c
[Dave Dykstra <[EMAIL PROTECTED]>] PR#4189
   
  
  
  
  1.430 +6 -1  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.429
  retrieving revision 1.430
  diff -u -r1.429 -r1.430
  --- http_main.c   1999/04/08 21:04:43 1.429
  +++ http_main.c   1999/04/20 19:15:39 1.430
  @@ -1079,8 +1079,13 @@
log_req = log_req->prev;
}
   
  - if (!current_conn->keptalive)
  + if (!current_conn->keptalive) {
  + /* in some cases we come here before setting the time */
  + if (log_req->request_time == 0) {
  +   log_req->request_time = time(0);
  + }
ap_log_transaction(log_req);
  + }
   
ap_bsetflag(save_req->connection->client, B_EOUT, 1);
ap_bclose(save_req->connection->client);
  
  
  
  1.264 +4 -0  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.263
  retrieving revision 1.264
  diff -u -r1.263 -r1.264
  --- http_protocol.c   1999/04/20 18:36:07 1.263
  +++ http_protocol.c   1999/04/20 19:15:41 1.264
  @@ -791,6 +791,10 @@
   while ((len = getline(l, sizeof(l), conn->client, 0)) <= 0) {
   if ((len < 0) || ap_bgetflag(conn->client, B_EOF)) {
   ap_bsetflag(conn->client, B_SAFEREAD, 0);
  + /* this is a hack to make sure that request time is set,
  +  * it's not perfect, but it's better than nothing 
  +  */
  + r->request_time = time(0);
   return 0;
   }
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-03-17 Thread manoj
manoj   99/03/17 15:05:47

  Modified:src/main http_main.c
  Log:
  Small bugfix. A child process used to exit after MaxRequestsPerChild - 1
  requests. This patch puts the increment of requests_this_child after the
  ap_max_requests_per_child check so the server will process that one
  last request before dying.
  
  Revision  ChangesPath
  1.427 +1 -1  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.426
  retrieving revision 1.427
  diff -u -u -r1.426 -r1.427
  --- http_main.c   1999/03/10 11:06:10 1.426
  +++ http_main.c   1999/03/17 23:05:43 1.427
  @@ -3621,7 +3621,7 @@
   
   #ifndef WIN32
if ((ap_max_requests_per_child > 0
  -  && ++requests_this_child >= ap_max_requests_per_child)) {
  +  && requests_this_child++ >= ap_max_requests_per_child)) {
clean_child_exit(0);
}
   #else
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-03-10 Thread rse
rse 99/03/10 03:06:12

  Modified:src  CHANGES Makefile.tmpl
   src/main http_main.c
  Log:
  Link the shared core bootstrap program (``SHARED_CORE'') also against libap.a
  and use it's ap_snprintf() instead of sprintf() to avoid possible buffer
  overflows.
  
  Hint given by: John Bley <[EMAIL PROTECTED]>
  Submitted by: Ralf S. Engelschall
  
  Revision  ChangesPath
  1.1270+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1269
  retrieving revision 1.1270
  diff -u -r1.1269 -r1.1270
  --- CHANGES   1999/03/10 10:34:00 1.1269
  +++ CHANGES   1999/03/10 11:06:06 1.1270
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.5
   
  +  *) Link the shared core bootstrap program (``Rule SHARED_CORE=yes'') also
  + against libap.a and use its ap_snprintf() instead of sprintf() to avoid
  + possible buffer overflows. [Ralf S. Engelschall]
  +
 *) Remove no longer used non-API function ap_single_module_init().
[Ralf S. Engelschall]
   
  
  
  
  1.109 +1 -1  apache-1.3/src/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  RCS file: /home/cvs/apache-1.3/src/Makefile.tmpl,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -r1.108 -r1.109
  --- Makefile.tmpl 1999/01/06 21:57:02 1.108
  +++ Makefile.tmpl 1999/03/10 11:06:07 1.109
  @@ -35,7 +35,7 @@
   
   target_shared: lib$(TARGET).ep
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
  -   -o $(TARGET) -DSHARED_CORE_BOOTSTRAP main/http_main.c
  +   -o $(TARGET) -DSHARED_CORE_BOOTSTRAP main/http_main.c ap/libap.a
   
   lib$(TARGET).ep: lib$(TARGET).$(SHLIB_SUFFIX_NAME)
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
  
  
  
  1.426 +3 -3  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.425
  retrieving revision 1.426
  diff -u -r1.425 -r1.426
  --- http_main.c   1999/03/08 15:44:00 1.425
  +++ http_main.c   1999/03/10 11:06:10 1.426
  @@ -6101,7 +6101,7 @@
   /* 
* create path to SHARED_CORE_EXECUTABLE_PROGRAM
*/
  -sprintf(prog, "%s/%s", llp_dir, SHARED_CORE_EXECUTABLE_PROGRAM);
  +ap_snprintf(prog, sizeof(prog), "%s/%s", llp_dir, 
SHARED_CORE_EXECUTABLE_PROGRAM);
   
   /* 
* adjust process environment therewith the Unix loader 
  @@ -6127,9 +6127,9 @@
envp[i] = NULL;
   }
   if (llp_existing != NULL)
  -  sprintf(llp_buf, "%s=%s:%s", VARNAME, llp_dir, llp_existing);
  +  ap_snprintf(llp_buf, sizeof(llp_buf), "%s=%s:%s", VARNAME, llp_dir, 
llp_existing);
   else
  -  sprintf(llp_buf, "%s=%s", VARNAME, llp_dir);
  +  ap_snprintf(llp_buf, sizeof(llp_buf), "%s=%s", VARNAME, llp_dir);
   *llp_slot = strdup(llp_buf);
   
   /* 
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-02-22 Thread coar
coar99/02/22 08:50:27

  Modified:src/main http_main.c
  Log:
Fix a typo.
  
  Submitted by: Shane Owenby <[EMAIL PROTECTED]>
  Reviewed by:  Ken Coar
  
  Revision  ChangesPath
  1.424 +1 -1  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.423
  retrieving revision 1.424
  diff -u -r1.423 -r1.424
  --- http_main.c   1999/02/20 18:12:35 1.423
  +++ http_main.c   1999/02/22 16:50:25 1.424
  @@ -4812,7 +4812,7 @@
   /* TODO: If too many jobs in queue, sleep, check for problems */
   ap_acquire_mutex(allowed_globals.jobmutex);
   new_job = (joblist *) malloc(sizeof(joblist));
  -if (new_jobs == NULL) {
  +if (new_job == NULL) {
fprintf(stderr, "Ouch!  Out of memory in add_job()!\n");
   }
   new_job->next = NULL;
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-02-09 Thread stoddard
stoddard99/02/09 05:18:20

  Modified:src/main http_main.c
  Log:
  OS/2 fix to supress bogus errno based messages and supply OS/2 error
  code.
  Submitted by: Brian Havard
  
  Revision  ChangesPath
  1.422 +6 -6  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.421
  retrieving revision 1.422
  diff -u -r1.421 -r1.422
  --- http_main.c   1999/02/05 09:12:44 1.421
  +++ http_main.c   1999/02/09 13:18:19 1.422
  @@ -898,8 +898,8 @@
   int rc = DosOpenMutexSem(NULL, &lock_sem);
   
   if (rc != 0) {
  - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  - "Child cannot open lock semaphore");
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf,
  + "Child cannot open lock semaphore, rc=%d", rc);
clean_child_exit(APEXIT_CHILDINIT);
   }
   }
  @@ -913,8 +913,8 @@
   int rc = DosCreateMutexSem(NULL, &lock_sem, DC_SEM_SHARED, FALSE);
   
   if (rc != 0) {
  - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  - "Parent cannot create lock semaphore");
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf,
  + "Parent cannot create lock semaphore, rc=%d", rc);
exit(APEXIT_INIT);
   }
   
  @@ -926,7 +926,7 @@
   int rc = DosRequestMutexSem(lock_sem, SEM_INDEFINITE_WAIT);
   
   if (rc != 0) {
  - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf,
"OS2SEM: Error %d getting accept lock. Exiting!", rc);
clean_child_exit(APEXIT_CHILDFATAL);
   }
  @@ -937,7 +937,7 @@
   int rc = DosReleaseMutexSem(lock_sem);
   
   if (rc != 0) {
  - ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf,
"OS2SEM: Error %d freeing accept lock. Exiting!", rc);
clean_child_exit(APEXIT_CHILDFATAL);
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-02-05 Thread pcs
pcs 99/02/05 01:12:45

  Modified:src/main http_main.c
  Log:
  The patch below prevents ap_open_logs() from being called if we have
  either a -i or -u command line option. So the user can see the error
  messages (if any) from -i or -u. It also prevents the printing of the
  "Apache running..." message, which implies that Apache has been started to
  service requests.
  
  Reviewed by:  Brian Behlendorf, Bill Stoddard
  
  Revision  ChangesPath
  1.421 +4 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.420
  retrieving revision 1.421
  diff -u -r1.420 -r1.421
  --- http_main.c   1999/01/28 18:27:19 1.420
  +++ http_main.c   1999/02/05 09:12:44 1.421
  @@ -5964,14 +5964,16 @@
   ap_init_modules(pconf, server_conf);
   ap_suexec_enabled = init_suexec();
   version_locked++;
  -ap_open_logs(server_conf, pconf);
  +if (!install) {
  + ap_open_logs(server_conf, pconf);
  +}
   set_group_privs();
   
   #ifdef OS2
   printf("%s running...\n", ap_get_server_version());
   #endif
   #ifdef WIN32
  -if (!child) {
  +if (!child && !install) {
printf("%s running...\n", ap_get_server_version());
   }
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-01-08 Thread martin
martin  99/01/08 00:48:47

  Modified:.STATUS
   src  CHANGES
   src/main http_main.c
  Log:
  The query switch "httpd -S" didn't exit after showing the
  vhost settings. That was inconsistent with the other query functions.
  Now it exits after printing.
  
  Reviewed by: Roy Fielding, Dean Gaudet
  
  Revision  ChangesPath
  1.594 +1 -5  apache-1.3/STATUS
  
  Index: STATUS
  ===
  RCS file: /export/home/cvs/apache-1.3/STATUS,v
  retrieving revision 1.593
  retrieving revision 1.594
  diff -u -r1.593 -r1.594
  --- STATUS1999/01/07 22:39:17 1.593
  +++ STATUS1999/01/08 08:48:43 1.594
  @@ -1,5 +1,5 @@
 1.3 STATUS:
  -  Last modified at [$Date: 1999/01/07 22:39:17 $]
  +  Last modified at [$Date: 1999/01/08 08:48:43 $]
   
   Release:
   
  @@ -56,10 +56,6 @@
vhost-xxx.html document out of it. -- rse
   
   Available Patches:
  -
  -* Martin's [PATCH] Make "-S" exit(0) after dumping the VHost settings
  -Message-ID: <[EMAIL PROTECTED]>
  -Status: Martin +1, Roy +1
   
   * Jim Patterson's patch to make mod_info work on Win32
   Message-ID: PR#1442
  
  
  
  1.1206+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1205
  retrieving revision 1.1206
  diff -u -r1.1205 -r1.1206
  --- CHANGES   1999/01/06 19:14:49 1.1205
  +++ CHANGES   1999/01/08 08:48:44 1.1206
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.4
   
  +  *) The query switch "httpd -S" didn't exit after showing the
  + vhost settings. That was inconsistent with the other query functions.
  + [Martin Kraemer]
  +
 *) Moved the MODULE_MAGIC_COOKIE from before the versions and
filename to the end of the STANDARD_MODULE_STUFF.  Its
presence at the beginning prevented reporting of the filename
  
  
  
  1.419 +4 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.418
  retrieving revision 1.419
  diff -u -r1.418 -r1.419
  --- http_main.c   1999/01/03 16:45:25 1.418
  +++ http_main.c   1999/01/08 08:48:46 1.419
  @@ -247,7 +247,7 @@
   time_t ap_restart_time;
   int ap_suexec_enabled = 0;
   int ap_listenbacklog;
  -int ap_dump_settings;
  +int ap_dump_settings = 0;
   API_VAR_EXPORT int ap_extended_status = 0;
   
   /*
  @@ -4576,6 +4576,9 @@
   
   if (configtestonly) {
   fprintf(stderr, "Syntax OK\n");
  +exit(0);
  +}
  +if (ap_dump_settings) {
   exit(0);
   }
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-01-03 Thread dgaudet
dgaudet 99/01/03 08:45:27

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Back out roy's previous change -- this sort of thing should be handled
  by a cleanup if a module really needs it.  Unless someone can demonstrate
  that there is broken libc code somewhere that absolutely needs this...
  
  Revision  ChangesPath
  1.1199+0 -5  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1198
  retrieving revision 1.1199
  diff -u -r1.1198 -r1.1199
  --- CHANGES   1999/01/03 13:35:30 1.1198
  +++ CHANGES   1999/01/03 16:45:23 1.1199
  @@ -3,11 +3,6 @@
 *) Change the ap_assert macro to a variant that works on all platforms.
[Richard Prinz <[EMAIL PROTECTED]>] PR#2575
   
  -  *) In order to prevent some errant library code from setting an alarm
  - on one request and having it affect some later connection, force the
  - alarm to be cleared before each connection even if Apache's own
  - timeouts are being handled by the parent. [Roy Fielding]
  -
 *) Make sure under ELF-based NetBSD (now) and OpenBSD (future) we don't
search for an underscore on dlsym() (as it's already the case
for FreeBSD 3.0). [Todd Vierling <[EMAIL PROTECTED]>] PR#2462
  
  
  
  1.418 +1 -4  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.417
  retrieving revision 1.418
  diff -u -r1.417 -r1.418
  --- http_main.c   1999/01/03 13:09:48 1.417
  +++ http_main.c   1999/01/03 16:45:25 1.418
  @@ -3610,10 +3610,7 @@
 * (Re)initialize this child to a pre-connection state.
 */
   
  - ap_kill_timeout(0); /* Cancel any outstanding alarms */
  -#ifdef OPTIMIZE_TIMEOUTS
  - alarm(0);   /* even if not set by Apache routines */
  -#endif
  + ap_kill_timeout(0); /* Cancel any outstanding alarms. */
current_conn = NULL;
   
ap_clear_pool(ptrans);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1999-01-03 Thread fielding
fielding99/01/03 05:09:49

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  In order to prevent some errant library code from setting an alarm
  on one request and having it affect some later connection, force the
  alarm to be cleared before each connection even if Apache's own
  timeouts are being handled by the parent.  This doesn't help for multiple
  requests on the same connection, but it is extremely unlikely that a
  request stream would persist longer than a non-Apache errant timeout,
  and this limits the problem to a single user without impacting performance.
  
  Revision  ChangesPath
  1.1197+5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1196
  retrieving revision 1.1197
  diff -u -r1.1196 -r1.1197
  --- CHANGES   1999/01/03 12:04:34 1.1196
  +++ CHANGES   1999/01/03 13:09:46 1.1197
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.4
   
  +  *) In order to prevent some errant library code from setting an alarm
  + on one request and having it affect some later connection, force the
  + alarm to be cleared before each connection even if Apache's own
  + timeouts are being handled by the parent. [Roy Fielding]
  +
 *) Make sure under ELF-based NetBSD (now) and OpenBSD (future) we don't
search for an underscore on dlsym() (as it's already the case
for FreeBSD 3.0). [Todd Vierling <[EMAIL PROTECTED]>] PR#2462
  
  
  
  1.417 +4 -1  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.416
  retrieving revision 1.417
  diff -u -r1.416 -r1.417
  --- http_main.c   1999/01/01 19:04:49 1.416
  +++ http_main.c   1999/01/03 13:09:48 1.417
  @@ -3610,7 +3610,10 @@
 * (Re)initialize this child to a pre-connection state.
 */
   
  - ap_kill_timeout(0); /* Cancel any outstanding alarms. */
  + ap_kill_timeout(0); /* Cancel any outstanding alarms */
  +#ifdef OPTIMIZE_TIMEOUTS
  + alarm(0);   /* even if not set by Apache routines */
  +#endif
current_conn = NULL;
   
ap_clear_pool(ptrans);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-12-31 Thread jim
jim 98/12/31 07:54:20

  Modified:.STATUS
   src  CHANGES
   src/main http_main.c
  Log:
  The "Module Apache Module" Server token problem with
  DSO fixed
  
  Revision  ChangesPath
  1.580 +3 -4  apache-1.3/STATUS
  
  Index: STATUS
  ===
  RCS file: /export/home/cvs/apache-1.3/STATUS,v
  retrieving revision 1.579
  retrieving revision 1.580
  diff -u -r1.579 -r1.580
  --- STATUS1998/12/31 14:09:11 1.579
  +++ STATUS1998/12/31 15:54:16 1.580
  @@ -1,5 +1,5 @@
 1.3 STATUS:
  -  Last modified at [$Date: 1998/12/31 14:09:11 $]
  +  Last modified at [$Date: 1998/12/31 15:54:16 $]
   
   Release:
   
  @@ -22,9 +22,8 @@
   
   * Version component misbehaviour
   See: <[EMAIL PROTECTED]>
  -Status: Ralf mentioned that he knows a solution... (?)
  - Is this the module placing it's token first? If so, I have
  - a patch: Jim
  +Status: Server token problem is fixed. Ralf still looking at
  + the "double module init" stuff.
   
   * Paul's [PATCH] Win32 device files
   Message-ID: <[EMAIL PROTECTED]>
  
  
  
  1.1184+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1183
  retrieving revision 1.1184
  diff -u -r1.1183 -r1.1184
  --- CHANGES   1998/12/30 01:20:14 1.1183
  +++ CHANGES   1998/12/31 15:54:17 1.1184
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.4
   
  +  *) Using DSO, the Server token was being mangled. Specifically, the
  + module's token was being added first before the Apache token. This
  + has been fixed. [Jim Jagielski]
  +
 *) Major overhaul of mod_negotiation.c.
- cleanups to mod_negotiation comments and code structure
- made compliant with HTTP/1.1 proposed standard (rfc2068) and added
  
  
  
  1.415 +2 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.414
  retrieving revision 1.415
  diff -u -r1.414 -r1.415
  --- http_main.c   1998/12/24 13:39:48 1.414
  +++ http_main.c   1998/12/31 15:54:19 1.415
  @@ -4595,8 +4595,10 @@
BUFF *cio;
NET_SIZE_T l;
   
  + ap_set_version();
/* Yes this is called twice. */
ap_init_modules(pconf, server_conf);
  + version_locked++;
ap_open_logs(server_conf, pconf);
ap_init_modules(pconf, server_conf);
set_group_privs();
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-12-24 Thread jim
jim 98/12/24 05:39:49

  Modified:src/include scoreboard.h
   src/main http_main.c
  Log:
  Good catch by Ben Hyde.
  
  Revision  ChangesPath
  1.45  +1 -1  apache-1.3/src/include/scoreboard.h
  
  Index: scoreboard.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/scoreboard.h,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- scoreboard.h  1998/12/04 19:12:15 1.44
  +++ scoreboard.h  1998/12/24 13:39:47 1.45
  @@ -189,7 +189,7 @@
   
   API_VAR_EXPORT extern scoreboard *ap_scoreboard_image;
   
  -API_VAR_EXPORT extern ap_generation_t ap_my_generation;
  +API_VAR_EXPORT extern ap_generation_t volatile ap_my_generation;
   
   /* for time_process_request() in http_main.c */
   #define START_PREQUEST 1
  
  
  
  1.414 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.413
  retrieving revision 1.414
  diff -u -r1.413 -r1.414
  --- http_main.c   1998/12/23 00:14:10 1.413
  +++ http_main.c   1998/12/24 13:39:48 1.414
  @@ -2568,7 +2568,7 @@
   static int volatile shutdown_pending;
   static int volatile restart_pending;
   static int volatile is_graceful;
  -int volatile ap_my_generation;
  +ap_generation_t volatile ap_my_generation;
   
   #ifdef WIN32
   /*
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-12-23 Thread martin
martin  98/12/22 16:14:11

  Modified:src/main http_main.c
  Log:
  Fix the SHARED_CORE_BOOTSTRAP main routine. It would not compile
  after recent changes because the undefined variable
  ap_server_argv0 was referenced.
  
  Revision  ChangesPath
  1.413 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.412
  retrieving revision 1.413
  diff -u -r1.412 -r1.413
  --- http_main.c   1998/12/17 15:09:31 1.412
  +++ http_main.c   1998/12/23 00:14:10 1.413
  @@ -6130,7 +6130,7 @@
   if (execve(prog, argv, envp) == -1) {
fprintf(stderr, 
"%s: Unable to exec Shared Core Executable Program `%s'\n",
  - ap_server_argv0, prog);
  + argv[0], prog);
return 1;
   }
   else
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-12-11 Thread jim
jim 98/12/11 07:33:41

  Modified:src/main http_main.c
  Log:
  This fixes the problem I was seeing on various platforms with non-Graceful
  restarts. It also explains why Graceful restarts worked OK. It looks like
  something similar might be needed for the Win32 sections of the code where
  ap_my_generation is adjusted in it's similar loop, but I ain't touching
  that! :)
  
  Revision  ChangesPath
  1.411 +3 -3  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.410
  retrieving revision 1.411
  diff -u -r1.410 -r1.411
  --- http_main.c   1998/12/10 20:51:56 1.410
  +++ http_main.c   1998/12/11 15:33:40 1.411
  @@ -4410,13 +4410,13 @@
 * use by any of the children.
 */
++ap_my_generation;
  + ap_scoreboard_image->global.running_generation = ap_my_generation;
  + update_scoreboard_global();
  +
if (is_graceful) {
   #ifndef SCOREBOARD_FILE
int i;
   #endif
  - ap_scoreboard_image->global.running_generation = ap_my_generation;
  - update_scoreboard_global();
  -
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
"SIGUSR1 received.  Doing graceful restart");
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-12-10 Thread jim
jim 98/12/10 12:51:57

  Modified:src/main http_main.c
  Log:
  Thanks to Dean for making me take a 2nd look
  
  Revision  ChangesPath
  1.410 +11 -10apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.409
  retrieving revision 1.410
  diff -u -r1.409 -r1.410
  --- http_main.c   1998/12/10 15:14:08 1.409
  +++ http_main.c   1998/12/10 20:51:56 1.410
  @@ -2069,18 +2069,19 @@
   sizeof(ss->request));
}
ss->vhostrec =  r->server;
  - } else if (status == SERVER_STARTING) {
  - /* clean up the slot's vhostrec pointer (maybe re-used)
  -  * and mark the slot as belonging to a new generation.
  -  */
  - ss->vhostrec = NULL;
  - ap_scoreboard_image->parent[child_num].generation = 
ap_my_generation;
  + }
  +}
  +if (status == SERVER_STARTING && r == NULL) {
  + /* clean up the slot's vhostrec pointer (maybe re-used)
  +  * and mark the slot as belonging to a new generation.
  +  */
  + ss->vhostrec = NULL;
  + ap_scoreboard_image->parent[child_num].generation = ap_my_generation;
   #ifdef SCOREBOARD_FILE
  - lseek(scoreboard_fd, XtOffsetOf(scoreboard, parent[child_num]), 0);
  - force_write(scoreboard_fd, &ap_scoreboard_image->parent[child_num],
  - sizeof(parent_score));
  + lseek(scoreboard_fd, XtOffsetOf(scoreboard, parent[child_num]), 0);
  + force_write(scoreboard_fd, &ap_scoreboard_image->parent[child_num],
  + sizeof(parent_score));
   #endif
  - }
   }
   put_scoreboard_info(child_num, ss);
   
  
  
  


Re: cvs commit: apache-1.3/src/main http_main.c

1998-12-10 Thread Dean Gaudet
This doesn't avoid the race.

You just added a huge race in the in-memory scoreboards.  I'll be
re-instating the second chunk of this patch. 

Dean

On 10 Dec 1998 [EMAIL PROTECTED] wrote:

> jim 98/12/10 07:14:10
> 
>   Modified:src/main http_main.c
>   Log:
>   Add 'reset slot vhost' logic to the
>   ap_update_child_status function and avoid the race as well.
>   
>   Revision  ChangesPath
>   1.409 +11 -9 apache-1.3/src/main/http_main.c
>   
>   Index: http_main.c
>   ===
>   RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
>   retrieving revision 1.408
>   retrieving revision 1.409
>   diff -u -r1.408 -r1.409
>   --- http_main.c 1998/12/04 19:12:16 1.408
>   +++ http_main.c 1998/12/10 15:14:08 1.409
>   @@ -2069,6 +2069,17 @@
>  sizeof(ss->request));
>   }
>   ss->vhostrec =  r->server;
>   +   } else if (status == SERVER_STARTING) {
>   +   /* clean up the slot's vhostrec pointer (maybe re-used)
>   +* and mark the slot as belonging to a new generation.
>   +*/
>   +   ss->vhostrec = NULL;
>   +   ap_scoreboard_image->parent[child_num].generation = 
> ap_my_generation;
>   +#ifdef SCOREBOARD_FILE
>   +   lseek(scoreboard_fd, XtOffsetOf(scoreboard, parent[child_num]), 0);
>   +   force_write(scoreboard_fd, &ap_scoreboard_image->parent[child_num],
>   +   sizeof(parent_score));
>   +#endif
>   }
>}
>put_scoreboard_info(child_num, ss);
>   @@ -3917,15 +3928,6 @@
>Explain1("Starting new child in slot %d", slot);
>(void) ap_update_child_status(slot, SERVER_STARTING, (request_rec *) 
> NULL);
>
>   -/* clean up the slot's vhostrec pointer now that it is being re-used,
>   - * and mark the slot as beloging to a new generation.
>   - */
>   -/* XXX: there's still a race condition here for file-based 
> scoreboards...
>   - * but... like, do we really care to spend yet another write() 
> operation
>   - * here? -djg
>   - */
>   -ap_scoreboard_image->servers[slot].vhostrec = NULL;
>   -ap_scoreboard_image->parent[slot].generation = ap_my_generation;
>
>#ifndef _OSD_POSIX
>if ((pid = fork()) == -1) {
>   
>   
>   
> 



cvs commit: apache-1.3/src/main http_main.c

1998-12-10 Thread jim
jim 98/12/10 07:14:10

  Modified:src/main http_main.c
  Log:
  Add 'reset slot vhost' logic to the
  ap_update_child_status function and avoid the race as well.
  
  Revision  ChangesPath
  1.409 +11 -9 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.408
  retrieving revision 1.409
  diff -u -r1.408 -r1.409
  --- http_main.c   1998/12/04 19:12:16 1.408
  +++ http_main.c   1998/12/10 15:14:08 1.409
  @@ -2069,6 +2069,17 @@
   sizeof(ss->request));
}
ss->vhostrec =  r->server;
  + } else if (status == SERVER_STARTING) {
  + /* clean up the slot's vhostrec pointer (maybe re-used)
  +  * and mark the slot as belonging to a new generation.
  +  */
  + ss->vhostrec = NULL;
  + ap_scoreboard_image->parent[child_num].generation = 
ap_my_generation;
  +#ifdef SCOREBOARD_FILE
  + lseek(scoreboard_fd, XtOffsetOf(scoreboard, parent[child_num]), 0);
  + force_write(scoreboard_fd, &ap_scoreboard_image->parent[child_num],
  + sizeof(parent_score));
  +#endif
}
   }
   put_scoreboard_info(child_num, ss);
  @@ -3917,15 +3928,6 @@
   Explain1("Starting new child in slot %d", slot);
   (void) ap_update_child_status(slot, SERVER_STARTING, (request_rec *) 
NULL);
   
  -/* clean up the slot's vhostrec pointer now that it is being re-used,
  - * and mark the slot as beloging to a new generation.
  - */
  -/* XXX: there's still a race condition here for file-based scoreboards...
  - * but... like, do we really care to spend yet another write() operation
  - * here? -djg
  - */
  -ap_scoreboard_image->servers[slot].vhostrec = NULL;
  -ap_scoreboard_image->parent[slot].generation = ap_my_generation;
   
   #ifndef _OSD_POSIX
   if ((pid = fork()) == -1) {
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-10-26 Thread coar
coar98/10/26 13:27:42

  Modified:src/main http_main.c
  Log:
Parents and children were dealing with the event handles in
a suboptimally-synchronised way.
  
  PR:   3255
  Submitted by: Ken Parzygnat <[EMAIL PROTECTED]>
  Reviewed by:  Ken Coar
  
  Revision  ChangesPath
  1.402 +3 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.401
  retrieving revision 1.402
  diff -u -r1.401 -r1.402
  --- http_main.c   1998/10/19 07:10:15 1.401
  +++ http_main.c   1998/10/26 21:27:40 1.402
  @@ -5654,8 +5654,6 @@
   APD2("*** main process shutdown, processes=%d ***", 
current_live_processes);
   
   die_now:
  -CloseHandle(signal_restart_event);
  -CloseHandle(signal_shutdown_event);
   
   tmstart = time(NULL);
   while (current_live_processes && ((tmstart+60) > time(NULL))) {
  @@ -5675,6 +5673,9 @@
"forcing termination of child #%d (handle %d)", i, 
process_handles[i]);
TerminateProcess((HANDLE) process_handles[i], 1);
   }
  +
  +CloseHandle(signal_restart_event);
  +CloseHandle(signal_shutdown_event);
   
   /* cleanup pid file on normal shutdown */
   {
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-10-19 Thread marc
marc98/10/19 00:10:17

  Modified:src/main http_main.c
  Log:
  Be more explicit in OS2/Win32 console box message; ie. print
  "Apache/x.x.x running..." instead of just "Apache/x.x.x".
  
  Revision  ChangesPath
  1.401 +2 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.400
  retrieving revision 1.401
  diff -u -r1.400 -r1.401
  --- http_main.c   1998/10/12 17:15:25 1.400
  +++ http_main.c   1998/10/19 07:10:15 1.401
  @@ -5887,11 +5887,11 @@
   set_group_privs();
   
   #ifdef OS2
  -printf("%s \n", ap_get_server_version());
  +printf("%s running...\n", ap_get_server_version());
   #endif
   #ifdef WIN32
   if (!child) {
  - printf("%s \n", ap_get_server_version());
  + printf("%s running...\n", ap_get_server_version());
   }
   #endif
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-10-12 Thread dgaudet
dgaudet 98/10/12 10:15:26

  Modified:src/main http_main.c
  Log:
  correct inconsistency in error message format
  
  Revision  ChangesPath
  1.400 +2 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.399
  retrieving revision 1.400
  diff -u -r1.399 -r1.400
  --- http_main.c   1998/10/06 15:41:44 1.399
  +++ http_main.c   1998/10/12 17:15:25 1.400
  @@ -1044,14 +1044,14 @@
if (sig == SIGPIPE) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
current_conn->server,
  - "(client %s) stopped connection before %s completed",
  + "[client %s] stopped connection before %s completed",
current_conn->remote_ip,
timeout_name ? timeout_name : "request");
}
else {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
current_conn->server,
  - "(client %s) %s timed out",
  + "[client %s] %s timed out",
current_conn->remote_ip,
timeout_name ? timeout_name : "request");
}
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-10-06 Thread pcs
pcs 98/10/06 08:41:46

  Modified:src/main http_main.c
  Log:
  WIN32: Add new options to let Apache signal itself to shutdown or
  restart. The option is -k, used like this:
  
-k shutdown
-k restart
  
  This lets people signal Apache on Win95 systems (where previously Apache
  was controlled by doing a ^C to stop it running).
  
  Reviewed by:  Ken, Lars, Jim, Martin (all concept only)
  
  Revision  ChangesPath
  1.399 +242 -84   apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.398
  retrieving revision 1.399
  diff -u -r1.398 -r1.399
  --- http_main.c   1998/10/06 15:36:02 1.398
  +++ http_main.c   1998/10/06 15:41:44 1.399
  @@ -999,6 +999,10 @@
   fprintf(stderr, "  -l   : list compiled-in modules\n");
   fprintf(stderr, "  -S   : show parsed settings (currently 
only vhost settings)\n");
   fprintf(stderr, "  -t   : run syntax test for configuration 
files only\n");
  +#ifdef WIN32
  +fprintf(stderr, "  -k shutdown  : tell running Apache to 
shutdown\n");
  +fprintf(stderr, "  -k restart   : tell running Apache to do a 
graceful restart\n");
  +#endif
   exit(1);
   }
   
  @@ -2542,17 +2546,41 @@
   
   #ifdef WIN32
   /*
  - * signal_parent() tells the parent process to wake up and do something.
  - * Once woken it will look at shutdown_pending and restart_pending to decide
  - * what to do. If neither variable is set, it will do a shutdown. This 
function
  - * if called by start_shutdown() or start_restart() in the parent's process
  - * space, so that the variables get set. However it can also be called 
  - * by child processes to force the parent to exit in an emergency.
  + * Signalling Apache on NT.
  + *
  + * Under Unix, Apache can be told to shutdown or restart by sending various
  + * signals (HUP, USR, TERM). On NT we don't have easy access to signals, so
  + * we use "events" instead. The parent apache process goes into a loop
  + * where it waits forever for a set of events. Two of those events are
  + * called
  + *
  + *apPID_shutdown
  + *apPID_restart
  + *
  + * (where PID is the PID of the apache parent process). When one of these
  + * is signalled, the Apache parent performs the appropriate action. The 
events
  + * can become signalled through internal Apache methods (e.g. if the child
  + * finds a fatal error and needs to kill its parent), via the service
  + * control manager (the control thread will signal the shutdown event when
  + * requested to stop the Apache service), from the -k Apache command line,
  + * or from any external program which finds the Apache PID from the
  + * httpd.pid file.
  + *
  + * The signal_parent() function, below, is used to signal one of these 
events.
  + * It can be called by any child or parent process, since it does not
  + * rely on global variables.
  + *
  + * On entry, type gives the event to signal. 0 means shutdown, 1 means 
  + * graceful restart.
*/
   
  -static void signal_parent(void)
  +static void signal_parent(int type)
   {
   HANDLE e;
  +char *signal_name;
  +extern char signal_shutdown_name[];
  +extern char signal_restart_name[];
  +
   /* after updating the shutdown_pending or restart flags, we need
* to wake up the parent process so it can see the changes. The
* parent will normally be waiting for either a child process
  @@ -2564,21 +2592,28 @@
return;
   }
   
  -APD1("*** SIGNAL_PARENT SET ***");
  +switch(type) {
  +case 0: signal_name = signal_shutdown_name; break;
  +case 1: signal_name = signal_restart_name; break;
  +default: return;
  +}
   
  -e = OpenEvent(EVENT_ALL_ACCESS, FALSE, "apache-signal");
  +APD2("signal_parent signalling event \"%s\"", signal_name);
  +
  +e = OpenEvent(EVENT_ALL_ACCESS, FALSE, signal_name);
   if (!e) {
  - /* Um, problem, can't signal the main loop, which means we can't
  + /* Um, problem, can't signal the parent, which means we can't
 * signal ourselves to die. Ignore for now...
 */
ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  - "OpenEvent on apache-signal event");
  + "OpenEvent on %s event", signal_name);
return;
   }
   if (SetEvent(e) == 0) {
/* Same problem as above */
ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf,
  - "SetEvent on apache-signal event");
  + "SetEvent on %s event", signal_name);
  + CloseHandle(e);
return;
   }
   CloseHandle(e);
  @@ -2586,24 +2621,19 @@
   #endif
   
   /*
  - * start_shutdown() and start_restart(), below, are a first stab at
  + * ap_start_shutdown() and ap_start_restart(), below, are a first stab at
  

cvs commit: apache-1.3/src/main http_main.c

1998-10-06 Thread pcs
pcs 98/10/06 08:36:04

  Modified:src/main http_main.c
  Log:
  Avoid warning about PID file being overwritten on each start of Apache.
  This had two causes: first, if "-i", "-u" or "-S" was given (none of which
  start a daemon) the PID file was being updated with the new PID. Secondly,
  doing "net stop apache" or stopping Apache from the SCM did not remove the
  PID file because reporting a STOPPED status to the SCM seems to stop the
  process, so move the reporting of the STOPPED service to the very last
  thing we do.
  
  PR: 3053, 3084
  
  Revision  ChangesPath
  1.398 +2 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.397
  retrieving revision 1.398
  diff -u -r1.397 -r1.398
  --- http_main.c   1998/09/21 10:16:11 1.397
  +++ http_main.c   1998/10/06 15:36:02 1.398
  @@ -5579,7 +5579,6 @@
"forcing termination of child #%d (handle %d)", i, 
process_handles[i]);
TerminateProcess((HANDLE) process_handles[i], 1);
   }
  -service_set_status(SERVICE_STOPPED);
   
   /* cleanup pid file on normal shutdown */
   {
  @@ -5597,6 +5596,7 @@
   }
   
   ap_destroy_mutex(start_mutex);
  +service_set_status(SERVICE_STOPPED);
   return (0);
   }
   
  @@ -5718,7 +5718,7 @@
   exit(0);
   }
   
  -if (!child) {
  +if (!child && !ap_dump_settings && !install) {
ap_log_pid(pconf, ap_pid_fname);
   }
   ap_set_version();
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-09-21 Thread pcs
pcs 98/09/21 03:16:12

  Modified:src/main http_main.c
  Log:
  Remove PID file on windows as well as Unix
  
  Revision  ChangesPath
  1.397 +11 -0 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.396
  retrieving revision 1.397
  diff -u -r1.396 -r1.397
  --- http_main.c   1998/09/20 10:53:53 1.396
  +++ http_main.c   1998/09/21 10:16:11 1.397
  @@ -5581,6 +5581,17 @@
   }
   service_set_status(SERVICE_STOPPED);
   
  +/* cleanup pid file on normal shutdown */
  +{
  + const char *pidfile = NULL;
  + pidfile = ap_server_root_relative (pparent, ap_pid_fname);
  + if ( pidfile != NULL && unlink(pidfile) == 0)
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
  +  server_conf,
  +  "httpd: removed PID file %s (pid=%ld)",
  +  pidfile, (long)getpid());
  +}
  +
   if (pparent) {
ap_destroy_pool(pparent);
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-09-20 Thread rse
rse 98/09/20 03:53:54

  Modified:src/main http_main.c
  Log:
  Use consistenly ANSI C "(void)" instead of "()" inside
  http_main.c and not a mixture of it. This also removes
  some gcc -Wstrict-prototype warnings.
  
  Revision  ChangesPath
  1.396 +15 -15apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.395
  retrieving revision 1.396
  diff -u -r1.395 -r1.396
  --- http_main.c   1998/09/18 06:43:28 1.395
  +++ http_main.c   1998/09/20 10:53:53 1.396
  @@ -363,7 +363,7 @@
   server_version = NULL;
   }
   
  -API_EXPORT(const char *) ap_get_server_version()
  +API_EXPORT(const char *) ap_get_server_version(void)
   {
   return (server_version ? server_version : SERVER_BASEVERSION);
   }
  @@ -396,7 +396,7 @@
* This routine adds the real server base identity to the version string,
* and then locks out changes until the next reconfig.
*/
  -static void ap_set_version()
  +static void ap_set_version(void)
   {
   if (ap_server_tokens == SrvTk_MIN) {
ap_add_version_component(SERVER_BASEVERSION);
  @@ -422,7 +422,7 @@
* GprofDir logs/   -> $ServerRoot/logs/gmon.out
* GprofDir logs/%  -> $ServerRoot/logs/gprof.$pid/gmon.out
*/
  -static void chdir_for_gprof()
  +static void chdir_for_gprof(void)
   {
   core_server_config *sconf = 
ap_get_module_config(server_conf->module_config, &core_module);
  @@ -511,7 +511,7 @@
   }
   }
   
  -static void accept_mutex_on()
  +static void accept_mutex_on(void)
   {
   switch (ussetlock(uslock)) {
   case 1:
  @@ -526,7 +526,7 @@
   }
   }
   
  -static void accept_mutex_off()
  +static void accept_mutex_off(void)
   {
   if (usunsetlock(uslock) == -1) {
perror("usunsetlock");
  @@ -608,7 +608,7 @@
   ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
   }
   
  -static void accept_mutex_on()
  +static void accept_mutex_on(void)
   {
   int err;
   
  @@ -624,7 +624,7 @@
   have_accept_mutex = 1;
   }
   
  -static void accept_mutex_off()
  +static void accept_mutex_off(void)
   {
   int err;
   
  @@ -730,7 +730,7 @@
   op_off.sem_flg = SEM_UNDO;
   }
   
  -static void accept_mutex_on()
  +static void accept_mutex_on(void)
   {
   if (semop(sem_id, &op_on, 1) < 0) {
perror("accept_mutex_on");
  @@ -738,7 +738,7 @@
   }
   }
   
  -static void accept_mutex_off()
  +static void accept_mutex_off(void)
   {
   if (semop(sem_id, &op_off, 1) < 0) {
perror("accept_mutex_off");
  @@ -1098,12 +1098,12 @@
* which is itself being cleared); we have to support that here.
*/
   
  -API_EXPORT(void) ap_block_alarms()
  +API_EXPORT(void) ap_block_alarms(void)
   {
   ++alarms_blocked;
   }
   
  -API_EXPORT(void) ap_unblock_alarms()
  +API_EXPORT(void) ap_unblock_alarms(void)
   {
   --alarms_blocked;
   if (alarms_blocked == 0) {
  @@ -1541,14 +1541,14 @@
   memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE);
   }
   
  -void cleanup_scoreboard()
  +void cleanup_scoreboard(void)
   {
   ap_assert(ap_scoreboard_image);
   free(ap_scoreboard_image);
   ap_scoreboard_image = NULL;
   }
   
  -API_EXPORT(void) ap_sync_scoreboard_image()
  +API_EXPORT(void) ap_sync_scoreboard_image(void)
   {
   }
   
  @@ -4717,7 +4717,7 @@
   ap_release_mutex(allowed_globals.jobmutex);
   }
   
  -int remove_job()
  +int remove_job(void)
   {
   joblist *job;
   int sock;
  @@ -5003,7 +5003,7 @@
   
   #define MAX_SELECT_ERRORS 100
   
  -void worker_main()
  +void worker_main(void)
   {
   /*
* I am writing this stuff specifically for NT.
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-09-18 Thread rse
rse 98/09/17 23:43:29

  Modified:src/main http_main.c
  Log:
  Remove nasty GCC messages about `nexted external declarations'
  under --enable-rule=SHARED_CORE situation.
  
  Revision  ChangesPath
  1.395 +5 -3  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.394
  retrieving revision 1.395
  diff -u -r1.394 -r1.395
  --- http_main.c   1998/09/17 16:24:44 1.394
  +++ http_main.c   1998/09/18 06:43:28 1.395
  @@ -5764,9 +5764,10 @@
   **  in the shared core library under run-time.
   */
   
  +extern int ap_main(int argc, char *argv[]);
  +
   int main(int argc, char *argv[]) 
   {
  -extern int ap_main(int argc, char *argv[]);
   return ap_main(argc, argv);
   }
   
  @@ -5804,10 +5805,11 @@
   #define SHARED_CORE_EXECUTABLE_PROGRAM "libhttpd.ep"
   #endif
   
  +extern char *optarg;
  +extern int   optind;
  +
   int main(int argc, char *argv[], char *envp[]) 
   {
  -extern char *optarg;
  -extern int optind;
   char prog[MAX_STRING_LEN];
   char llp_buf[MAX_STRING_LEN];
   char **llp_slot;
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-09-17 Thread rse
rse 98/09/17 09:24:45

  Modified:src/main http_main.c
  Log:
  Make GCC happy under SHARED_CORE, too.
  
  Revision  ChangesPath
  1.394 +1 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.393
  retrieving revision 1.394
  diff -u -r1.393 -r1.394
  --- http_main.c   1998/09/17 14:43:25 1.393
  +++ http_main.c   1998/09/17 16:24:44 1.394
  @@ -83,6 +83,7 @@
   
   #ifdef SHARED_CORE
   #define REALMAIN ap_main
  +int ap_main(int argc, char *argv[]);
   #else
   #define REALMAIN main
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-09-17 Thread rse
rse 98/09/17 07:43:27

  Modified:src  CHANGES Configure Makefile.tmpl
   .Makefile.tmpl
   src/main http_main.c
  Log:
  Fix SHARED_CORE feature for HPUX platform: We now use extension `.sl'
  instead of `.so' and `SHLIB_PATH' instead of `LD_LIBRARY_PATH' on this
  platform to make the braindead HPUX linker happy. Notice, for the module
  DSOs we don't have to use this, because these are loaded manually (and
  not via HPUX' dld).
  
  PR: 2905, 2968
  
  Revision  ChangesPath
  1.1066+6 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1065
  retrieving revision 1.1066
  diff -u -r1.1065 -r1.1066
  --- CHANGES   1998/09/17 12:15:30 1.1065
  +++ CHANGES   1998/09/17 14:43:18 1.1066
  @@ -1,5 +1,11 @@
   Changes with Apache 1.3.2
   
  +  *) Fix SHARED_CORE feature for HPUX platform: We now use extension `.sl'
  + instead of `.so' and `SHLIB_PATH' instead of `LD_LIBRARY_PATH' on this
  + platform to make the braindead HPUX linker happy. Notice, for the module
  + DSOs we don't have to use this, because these are loaded manually (and
  + not via HPUX' dld). [Ralf S. Engelschall] PR#2905, PR#2968
  +
 *) Remove 64 thread limit on Win32.
[Bill Stoddard <[EMAIL PROTECTED]>]
   
  
  
  
  1.291 +6 -1  apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /export/home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.290
  retrieving revision 1.291
  diff -u -r1.290 -r1.291
  --- Configure 1998/09/17 04:09:39 1.290
  +++ Configure 1998/09/17 14:43:20 1.291
  @@ -256,6 +256,7 @@
   SHELL="/bin/sh"
   TARGET="httpd"
   SUBTARGET="target_static"
  +SHLIB_SUFFIX_NAME=""
   SHLIB_SUFFIX_LIST=""
   CAT="cat"
   
  @@ -873,6 +874,7 @@
   LD_SHLIB="ld"
   DEF_SHARED_CORE=no
   DEF_SHARED_CHAIN=no
  +SHLIB_SUFFIX_NAME=so
   SHLIB_SUFFIX_DEPTH=all
   SHLIB_EXPORT_FILES=no
   case "$PLAT" in
  @@ -1049,6 +1051,7 @@
   esac
   LDFLAGS_SHLIB="-b"
   LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred"
  +SHLIB_SUFFIX_NAME=sl
   ;;
   *-hp-hpux10.*|*-hp-hpux11.*)
   case $CC in
  @@ -1056,7 +1059,8 @@
   */cc|cc   ) CFLAGS_SHLIB="+z" ;;
   esac
   LDFLAGS_SHLIB="-b"
  -LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred"
  +LDFLAGS_SHLIB_EXPORT="-Wl,-E -Wl,-B,deferred -Wl,+s"
  +SHLIB_SUFFIX_NAME=sl
   ;;
   *-ibm-aix*)
   case $CC in
  @@ -1667,6 +1671,7 @@
   echo "TARGET=$TARGET" >> Makefile
   echo "SUBDIRS=$SUBDIRS" >> Makefile
   echo "SUBTARGET=$SUBTARGET" >> Makefile
  +echo "SHLIB_SUFFIX_NAME=$SHLIB_SUFFIX_NAME" >> Makefile
   echo "SHLIB_SUFFIX_LIST=$SHLIB_SUFFIX_LIST" >> Makefile
   echo "" >> Makefile
   
  
  
  
  1.106 +6 -6  apache-1.3/src/Makefile.tmpl
  
  Index: Makefile.tmpl
  ===
  RCS file: /export/home/cvs/apache-1.3/src/Makefile.tmpl,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- Makefile.tmpl 1998/09/07 06:59:31 1.105
  +++ Makefile.tmpl 1998/09/17 14:43:21 1.106
  @@ -34,20 +34,20 @@
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
  -o $(TARGET) -DSHARED_CORE_BOOTSTRAP main/http_main.c
   
  -libhttpd.ep: libhttpd.so
  +libhttpd.ep: libhttpd.$(SHLIB_SUFFIX_NAME)
$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
  -o libhttpd.ep -DSHARED_CORE_TIESTATIC main/http_main.c \
  -L. -lhttpd $(LIBS)
   
  -libhttpd.so: subdirs modules.o
  +libhttpd.$(SHLIB_SUFFIX_NAME): subdirs modules.o
$(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
  - $(LD_SHLIB) $(LDFLAGS_SHLIB) -o libhttpd.so buildmark.o $(OBJS) 
$(REGLIB)
  + $(LD_SHLIB) $(LDFLAGS_SHLIB) -o libhttpd.$(SHLIB_SUFFIX_NAME) 
buildmark.o $(OBJS) $(REGLIB)
@if [ ".$(SHLIB_SUFFIX_LIST)" != . ]; then \
  - rm -f libhttpd.so.*; \
  + rm -f libhttpd.$(SHLIB_SUFFIX_NAME).*; \
for suffix in $(SHLIB_SUFFIX_LIST) ""; do \
[ ".$$suffix" = . ] && continue; \
  - echo "ln libhttpd.so libhttpd.so.$$suffix"; \
  - ln libhttpd.so libhttpd.so.$$suffix; \
  + echo "ln libhttpd.$(SHLIB_SUFFIX_NAME) 
libhttpd.$(SHLIB_SUFFIX_NAME).$$suffix"; \
  + ln libhttpd.$(SHLIB_SUFFIX_NAME) 
libhttpd.$(SHLIB_SUFFIX_NAME).$$suffix; \
done; \
fi
   
  
  
  
  1.47  +8 -7  apache-1.3/Makefile.tmpl
  
  Index: Makefile.tmpl
  =

cvs commit: apache-1.3/src/main http_main.c

1998-09-15 Thread fielding
fielding98/09/14 18:19:35

  Modified:src/main http_main.c
  Log:
  Fix gcc warning on Solaris --> pid_t and %d don't match.
  
  Revision  ChangesPath
  1.391 +4 -3  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.390
  retrieving revision 1.391
  diff -u -r1.390 -r1.391
  --- http_main.c   1998/09/15 00:15:19 1.390
  +++ http_main.c   1998/09/15 01:19:32 1.391
  @@ -4294,9 +4294,10 @@
const char *pidfile = NULL;
pidfile = ap_server_root_relative (pconf, ap_pid_fname);
if ( pidfile != NULL && unlink(pidfile) == 0)
  - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 
server_conf,
  -  "httpd: removed PID file %s (pid=%d)",
  -  pidfile, getpid());
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,
  +  server_conf,
  +  "httpd: removed PID file %s (pid=%ld)",
  +  pidfile, (long)getpid());
}
   
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-09-10 Thread stoddard
stoddard98/09/10 10:38:02

  Modified:src/main http_main.c
  Log:
  Remove NT 64 thread limit.
  Submitted by: Ken Parzygnat, Bill Stoddard
  Reviewed by:  Bill Stoddard
  
  Revision  ChangesPath
  1.389 +43 -3 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.388
  retrieving revision 1.389
  diff -u -r1.388 -r1.389
  --- http_main.c   1998/08/26 20:01:22 1.388
  +++ http_main.c   1998/09/10 17:38:00 1.389
  @@ -4919,7 +4919,46 @@
handles[i] = handles[i + 1];
   (*thread_cnt)--;
   }
  -
  +#ifdef WIN32
  +/*
  + * The Win32 call WaitForMultipleObjects will only allow you to wait for 
  + * a maximum of MAXIMUM_WAIT_OBJECTS (current 64).  Since the threading 
  + * model in the multithreaded version of apache wants to use this call, 
  + * we are restricted to a maximum of 64 threads.  This is a simplistic 
  + * routine that will increase this size.
  + */
  +DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles, 
  +DWORD dwSeconds)
  +{
  +time_t tStopTime;
  +DWORD dwRet = WAIT_TIMEOUT;
  +DWORD dwIndex=0;
  +BOOL bFirst = TRUE;
  +  
  +tStopTime = time(NULL) + dwSeconds;
  +  
  +do {
  +if (!bFirst)
  +Sleep(1000);
  +else
  +bFirst = FALSE;
  +  
  +for (dwIndex = 0; dwIndex * MAXIMUM_WAIT_OBJECTS < nCount; 
dwIndex++) {
  +dwRet = WaitForMultipleObjects(
  +min(MAXIMUM_WAIT_OBJECTS, 
  +nCount - (dwIndex * MAXIMUM_WAIT_OBJECTS)),
  +lpHandles + (dwIndex * MAXIMUM_WAIT_OBJECTS), 
  +0, 0);
  +   
  +if (dwRet != WAIT_TIMEOUT) { 
 
  +  break;
  +}
  +}
  +} while((time(NULL) < tStopTime) && (dwRet == WAIT_TIMEOUT));
  +
  +return dwRet;
  +}
  +#endif
   /*
* Executive routines.
*/
  @@ -5074,7 +5113,7 @@
/* Lets not break yet - we may have threads to clean up */
/* break;*/
}
  - rv = WaitForMultipleObjects(nthreads, child_handles, 0, 0);
  + rv = wait_for_many_objects(nthreads, child_handles, 0);
ap_assert(rv != WAIT_FAILED);
if (rv != WAIT_TIMEOUT) {
rv = rv - WAIT_OBJECT_0;
  @@ -5185,7 +5224,8 @@
   /* Wait for all your children */
   end_time = time(NULL) + 180;
   while (nthreads) {
  - rv = WaitForMultipleObjects(nthreads, child_handles, 0, (end_time - 
time(NULL)) * 1000);
  +rv = wait_for_many_objects(nthreads, child_handles, 
  +   end_time - time(NULL));
if (rv != WAIT_TIMEOUT) {
rv = rv - WAIT_OBJECT_0;
ap_assert((rv >= 0) && (rv < nthreads));
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-08-12 Thread martin
martin  98/08/12 03:33:40

  Modified:src/main http_main.c
  Log:
  Extend the output of the -V switch to include the paths of all
  compiled-in configuration files, if they were overridden at
  compile time, for least astonishment of the user.
  
  Revision  ChangesPath
  1.385 +38 -3 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.384
  retrieving revision 1.385
  diff -u -u -r1.384 -r1.385
  --- http_main.c   1998/08/11 20:28:22 1.384
  +++ http_main.c   1998/08/12 10:33:39 1.385
  @@ -3232,9 +3232,6 @@
   #ifdef SECURITY_HOLE_PASS_AUTHORIZATION
   printf(" -D SECURITY_HOLE_PASS_AUTHORIZATION\n");
   #endif
  -#ifdef HTTPD_ROOT
  -printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
  -#endif
   #ifdef HAVE_MMAP
   printf(" -D HAVE_MMAP\n");
   #endif
  @@ -3306,6 +3303,44 @@
   #endif
   #ifdef SHARED_CORE
   printf(" -D SHARED_CORE\n");
  +#endif
  +
  +/* This list displays the compiled-in default paths: */
  +#ifdef HTTPD_ROOT
  +printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
  +#endif
  +#ifdef SUEXEC_BIN
  +printf(" -D SUEXEC_BIN=\"" SUEXEC_BIN "\"\n");
  +#endif
  +#ifdef SHARED_CORE_DIR
  +printf(" -D SHARED_CORE_DIR=\"" SHARED_CORE_DIR "\"\n");
  +#endif
  +#ifdef DEFAULT_PIDLOG
  +printf(" -D DEFAULT_PIDLOG=\"" DEFAULT_PIDLOG "\"\n");
  +#endif
  +#ifdef DEFAULT_SCOREBOARD
  +printf(" -D DEFAULT_SCOREBOARD=\"" DEFAULT_SCOREBOARD "\"\n");
  +#endif
  +#ifdef DEFAULT_LOCKFILE
  +printf(" -D DEFAULT_LOCKFILE=\"" DEFAULT_LOCKFILE "\"\n");
  +#endif
  +#ifdef DEFAULT_XFERLOG
  +printf(" -D DEFAULT_XFERLOG=\"" DEFAULT_XFERLOG "\"\n");
  +#endif
  +#ifdef DEFAULT_ERRORLOG
  +printf(" -D DEFAULT_ERRORLOG=\"" DEFAULT_ERRORLOG "\"\n");
  +#endif
  +#ifdef TYPES_CONFIG_FILE
  +printf(" -D TYPES_CONFIG_FILE=\"" TYPES_CONFIG_FILE "\"\n");
  +#endif
  +#ifdef SERVER_CONFIG_FILE
  +printf(" -D SERVER_CONFIG_FILE=\"" SERVER_CONFIG_FILE "\"\n");
  +#endif
  +#ifdef ACCESS_CONFIG_FILE
  +printf(" -D ACCESS_CONFIG_FILE=\"" ACCESS_CONFIG_FILE "\"\n");
  +#endif
  +#ifdef RESOURCE_CONFIG_FILE
  +printf(" -D RESOURCE_CONFIG_FILE=\"" RESOURCE_CONFIG_FILE "\"\n");
   #endif
   }
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-08-11 Thread jim
jim 98/08/11 11:08:29

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Per Brian's request, when processes are in
  BUSY_READ mode, mod_status no longer shows the old, previous request
  info
  
  Revision  ChangesPath
  1.1019+4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1018
  retrieving revision 1.1019
  diff -u -r1.1018 -r1.1019
  --- CHANGES   1998/08/11 09:26:20 1.1018
  +++ CHANGES   1998/08/11 18:08:25 1.1019
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.2
   
  +  *) When READing a request in ExtendedStatus mode, the "old"
  + vhost, request and client information is cleared out.
  + [Jim Jagielski]
  +
 *) STATUS is no longer available. Full status information now
run-time configurable using the ExtendedStatus directive.
[Jim Jagielski]
  
  
  
  1.383 +7 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.382
  retrieving revision 1.383
  diff -u -r1.382 -r1.383
  --- http_main.c   1998/08/11 17:40:46 1.382
  +++ http_main.c   1998/08/11 18:08:27 1.383
  @@ -1993,6 +1993,13 @@
   sizeof(ss->request));
}
ap_cpystrn(ss->vhost, r->server->server_hostname, 
sizeof(ss->vhost));
  + } else if (status == SERVER_BUSY_READ) {
  + /*
  +  * When reading a "new" request, we don't want to show the old 
  +  * info since that's confusing... so NULL it out quickly since
  +  * we want to hurry up and read the request.
  +  */
  + *ss->vhost = *ss->request = *ss->client = '\0';
}
   }
   put_scoreboard_info(child_num, ss);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-08-11 Thread jim
jim 98/08/11 10:40:48

  Modified:src/main http_main.c
  Log:
  Minor formatting change
  
  Revision  ChangesPath
  1.382 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.381
  retrieving revision 1.382
  diff -u -r1.381 -r1.382
  --- http_main.c   1998/08/11 00:09:45 1.381
  +++ http_main.c   1998/08/11 17:40:46 1.382
  @@ -1981,7 +1981,7 @@
conn_rec *c = r->connection;
ap_cpystrn(ss->client, ap_get_remote_host(c, r->per_dir_config,
  REMOTE_NOLOOKUP), sizeof(ss->client));
  - if (r->the_request == NULL) {
  + if (r->the_request == NULL) {
ap_cpystrn(ss->request, "NULL", sizeof(ss->request));
} else if (r->parsed_uri.password == NULL) {
ap_cpystrn(ss->request, r->the_request, 
sizeof(ss->request));
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-08-07 Thread dgaudet
dgaudet 98/08/07 08:35:54

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  fix os/2 mutex problem
  
  Submitted by: Brian Havard
  
  Revision  ChangesPath
  1.1010+2 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1009
  retrieving revision 1.1010
  diff -u -r1.1009 -r1.1010
  --- CHANGES   1998/08/06 23:32:01 1.1009
  +++ CHANGES   1998/08/07 15:35:45 1.1010
  @@ -1,5 +1,7 @@
   Changes with Apache 1.3.2
   
  +  *) Fix a problem with the new OS/2 mutexes.  [Brian Havard]
  +
 *) Enhance mod_spelling so that CheckSpelling can be used in
 containers and .htaccess files.  [Ken Coar]
   
  
  
  
  1.380 +1 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.379
  retrieving revision 1.380
  diff -u -r1.379 -r1.380
  --- http_main.c   1998/08/06 17:30:29 1.379
  +++ http_main.c   1998/08/07 15:35:49 1.380
  @@ -845,6 +845,7 @@
   
   static void accept_mutex_cleanup(void *foo)
   {
  +DosReleaseMutexSem(lock_sem);
   DosCloseMutexSem(lock_sem);
   }
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-08-03 Thread Ralf S. Engelschall
rse 98/08/03 00:34:04

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Fix suEXEC start message: Has to be of `notice' level to really get
  printed together with the standard startup message because the `notice'
  level is handled special inside ap_log_error() for startup messages.
  
  PR: 2761, 2761, 2765
  
  Revision  ChangesPath
  1.996 +5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.995
  retrieving revision 1.996
  diff -u -r1.995 -r1.996
  --- CHANGES   1998/08/03 07:18:30 1.995
  +++ CHANGES   1998/08/03 07:34:01 1.996
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.2
   
  +  *) Fix suEXEC start message: Has to be of `notice' level to really get
  + printed together with the standard startup message because the `notice'
  + level is handled special inside ap_log_error() for startup messages.
  + [Ralf S. Engelschall] PR#2761 PR#2761 PR#2765
  +
 *) Add correct `model' MIME types from RFC2077 to mime.types file.
[Ralf S. Engelschall] PR#2732
   
  
  
  
  1.377 +3 -3  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.376
  retrieving revision 1.377
  diff -u -r1.376 -r1.377
  --- http_main.c   1998/08/02 04:43:17 1.376
  +++ http_main.c   1998/08/03 07:34:03 1.377
  @@ -4139,12 +4139,12 @@
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
"%s configured -- resuming normal operations",
ap_get_server_version());
  - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  - "Server built: %s", ap_get_server_built());
if (ap_suexec_enabled) {
  - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf,
 "suEXEC mechanism enabled (wrapper: %s)", SUEXEC_BIN);
}
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  + "Server built: %s", ap_get_server_built());
restart_pending = shutdown_pending = 0;
   
while (!restart_pending && !shutdown_pending) {
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c

1998-08-02 Thread fielding
fielding98/08/01 21:43:19

  Modified:src  CHANGES
   src/main http_main.c http_protocol.c
  Log:
  Allow ap_read_request errors to propagate through the normal request
  handling loop so that the connection can be properly closed with
  lingering_close, thus avoiding a potential TCP reset that would
  cause the client to miss the HTTP error response.
  
  Revision  ChangesPath
  1.993 +5 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.992
  retrieving revision 1.993
  diff -u -r1.992 -r1.993
  --- CHANGES   1998/07/28 17:26:43 1.992
  +++ CHANGES   1998/08/02 04:43:15 1.993
  @@ -1,5 +1,10 @@
   Changes with Apache 1.3.2
   
  +  *) Allow ap_read_request errors to propagate through the normal request
  + handling loop so that the connection can be properly closed with
  + lingering_close, thus avoiding a potential TCP reset that would
  + cause the client to miss the HTTP error response.  [Roy Fielding]
  +
 *) One more portability fix for APACI shadow tree support: Swap order of 
awk
and sed in top-level configure script to avoid sed fails on some
platforms (for instance SunOS 4.1.3 and NCR SysV) because of the
  
  
  
  1.376 +14 -9 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.375
  retrieving revision 1.376
  diff -u -r1.375 -r1.376
  --- http_main.c   1998/07/20 16:37:11 1.375
  +++ http_main.c   1998/08/02 04:43:17 1.376
  @@ -3699,8 +3699,11 @@
   
(void) ap_update_child_status(my_child_num, SERVER_BUSY_WRITE, r);
   
  - ap_process_request(r);
  + /* process the request if it was read without error */
   
  + if (r->status == HTTP_OK)
  + ap_process_request(r);
  +
   #if defined(STATUS)
increment_counts(my_child_num, r);
   #endif
  @@ -4466,15 +4469,16 @@
conn = new_connection(ptrans, server_conf, cio,
  (struct sockaddr_in *) &sa_client,
  (struct sockaddr_in *) &sa_server, -1);
  - r = ap_read_request(conn);
  - if (r)
  - ap_process_request(r);  /* else premature EOF (ignore) */
   
  - while (r && conn->keepalive && !conn->aborted) {
  - ap_destroy_pool(r->pool);
  - r = ap_read_request(conn);
  - if (r)
  + while ((r = ap_read_request(conn)) != NULL) {
  +
  + if (r->status == HTTP_OK)
ap_process_request(r);
  +
  + if (!conn->keepalive || conn->aborted)
  + break;
  +
  + ap_destroy_pool(r->pool);
}
   
ap_bclose(cio);
  @@ -4779,7 +4783,8 @@
while ((r = ap_read_request(current_conn)) != NULL) {
(void) ap_update_child_status(child_num, SERVER_BUSY_WRITE, r);
   
  - ap_process_request(r);
  + if (r->status == HTTP_OK)
  + ap_process_request(r);
   
   #if defined(STATUS)
increment_counts(child_num, r);
  
  
  
  1.227 +2 -3  apache-1.3/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===
  RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
  retrieving revision 1.226
  retrieving revision 1.227
  diff -u -r1.226 -r1.227
  --- http_protocol.c   1998/07/22 05:48:21 1.226
  +++ http_protocol.c   1998/08/02 04:43:18 1.227
  @@ -803,8 +803,8 @@
   ap_send_error_response(r, 0);
   ap_bflush(r->connection->client);
   ap_log_transaction(r);
  +return r;
   }
  -r->connection->aborted = 1;
   return NULL;
   }
   if (!r->assbackwards) {
  @@ -819,8 +819,7 @@
   ap_send_error_response(r, 0);
   ap_bflush(r->connection->client);
   ap_log_transaction(r);
  -r->connection->aborted = 1;
  -return NULL;
  +return r;
   }
   }
   else {
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-07-20 Thread dgaudet
dgaudet 98/07/20 09:37:15

  Modified:src  CHANGES
   src/include ap_config.h
   src/main http_main.c
  Log:
  serialized accepts for OS/2
  
  Submitted by: Brian Havard
  
  Revision  ChangesPath
  1.972 +2 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.971
  retrieving revision 1.972
  diff -u -r1.971 -r1.972
  --- CHANGES   1998/07/20 16:33:56 1.971
  +++ CHANGES   1998/07/20 16:37:05 1.972
  @@ -1,4 +1,6 @@
   Changes with Apache 1.3.2
  +  
  +  *) PORT: implement serialized accepts for OS/2.  [Brian Havard]
   
 *) mod_include had problems with the fsize and flastmod directives
under WIN32.  Fix also avoids the minor security hole of using
  
  
  
  1.228 +1 -0  apache-1.3/src/include/ap_config.h
  
  Index: ap_config.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/ap_config.h,v
  retrieving revision 1.227
  retrieving revision 1.228
  diff -u -r1.227 -r1.228
  --- ap_config.h   1998/07/18 15:30:43 1.227
  +++ ap_config.h   1998/07/20 16:37:09 1.228
  @@ -671,6 +671,7 @@
   #define MAXSOCKETS 4096
   #define USE_OS2_SCOREBOARD
   #define NO_RELIABLE_PIPED_LOGS
  +#define USE_OS2SEM_SERIALIZED_ACCEPT
   
   #elif defined(__MACHTEN__)
   typedef int rlim_t;
  
  
  
  1.375 +64 -0 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.374
  retrieving revision 1.375
  diff -u -r1.374 -r1.375
  --- http_main.c   1998/07/14 09:57:56 1.374
  +++ http_main.c   1998/07/20 16:37:11 1.375
  @@ -190,6 +190,7 @@
   /* Add MMAP style functionality to OS/2 */
   #define INCL_DOSMEMMGR
   #define INCL_DOSEXCEPTIONS
  +#define INCL_DOSSEMAPHORES
   #include 
   #include 
   #include 
  @@ -834,6 +835,69 @@
   if (flock(lock_fd, LOCK_UN) < 0) {
ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
"flock: LOCK_UN: Error freeing accept lock. Exiting!");
  + clean_child_exit(APEXIT_CHILDFATAL);
  +}
  +}
  +
  +#elif defined(USE_OS2SEM_SERIALIZED_ACCEPT)
  +
  +static HMTX lock_sem = -1;
  +
  +static void accept_mutex_cleanup(void *foo)
  +{
  +DosCloseMutexSem(lock_sem);
  +}
  +
  +/*
  + * Initialize mutex lock.
  + * Done by each child at it's birth
  + */
  +static void accept_mutex_child_init(pool *p)
  +{
  +int rc = DosOpenMutexSem(NULL, &lock_sem);
  +
  +if (rc != 0) {
  + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + "Child cannot open lock semaphore");
  + clean_child_exit(APEXIT_CHILDINIT);
  +}
  +}
  +
  +/*
  + * Initialize mutex lock.
  + * Must be safe to call this on a restart.
  + */
  +static void accept_mutex_init(pool *p)
  +{
  +int rc = DosCreateMutexSem(NULL, &lock_sem, DC_SEM_SHARED, FALSE);
  +
  +if (rc != 0) {
  + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + "Parent cannot create lock semaphore");
  + exit(APEXIT_INIT);
  +}
  +
  +ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
  +}
  +
  +static void accept_mutex_on(void)
  +{
  +int rc = DosRequestMutexSem(lock_sem, SEM_INDEFINITE_WAIT);
  +
  +if (rc != 0) {
  + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + "OS2SEM: Error %d getting accept lock. Exiting!", rc);
  + clean_child_exit(APEXIT_CHILDFATAL);
  +}
  +}
  +
  +static void accept_mutex_off(void)
  +{
  +int rc = DosReleaseMutexSem(lock_sem);
  +
  +if (rc != 0) {
  + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf,
  + "OS2SEM: Error %d freeing accept lock. Exiting!", rc);
clean_child_exit(APEXIT_CHILDFATAL);
   }
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-07-14 Thread martin
martin  98/07/14 02:57:58

  Modified:src/main http_main.c
  Log:
  Adjust SHARED_CORE main() code to accept the same options as the "real" main.
  Especially -D  and -t were rejected.
  
  Reviewed by: Ralf Engelschall
  
  Revision  ChangesPath
  1.374 +4 -1  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.373
  retrieving revision 1.374
  diff -u -u -r1.373 -r1.374
  --- http_main.c   1998/07/14 09:49:10 1.373
  +++ http_main.c   1998/07/14 09:57:56 1.374
  @@ -5607,8 +5607,9 @@
* but only handle the -L option 
*/
   llp_dir = SHARED_CORE_DIR;
  -while ((c = getopt(argc, argv, "C:c:Xd:f:vVhlL:Z:")) != -1) {
  +while ((c = getopt(argc, argv, "D:C:c:Xd:f:vVhlL:SZ:t")) != -1) {
switch (c) {
  + case 'D':
case 'C':
case 'c':
case 'X':
  @@ -5618,7 +5619,9 @@
case 'V':
case 'h':
case 'l':
  + case 'S':
case 'Z':
  + case 't':
case '?':
break;
case 'L':
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-07-14 Thread martin
martin  98/07/14 02:49:11

  Modified:src/main http_main.c
  Log:
  Add missing Usage() line for new -D  switch
  
  Revision  ChangesPath
  1.373 +1 -0  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.372
  retrieving revision 1.373
  diff -u -u -r1.372 -r1.373
  --- http_main.c   1998/07/13 11:32:39 1.372
  +++ http_main.c   1998/07/14 09:49:10 1.373
  @@ -883,6 +883,7 @@
   #ifdef SHARED_CORE
   fprintf(stderr, "  -L directory : specify an alternate location for 
shared object files\n");
   #endif
  +fprintf(stderr, "  -D name  : define a name for use in  directives\n");
   fprintf(stderr, "  -d directory : specify an alternate initial 
ServerRoot\n");
   fprintf(stderr, "  -f file  : specify an alternate 
ServerConfigFile\n");
   fprintf(stderr, "  -C \"directive\"   : process directive before reading 
config files\n");
  
  
  


cvs commit: apache-1.3/src/main http_main.c rfc1413.c

1998-07-08 Thread dgaudet
dgaudet 98/07/08 09:54:37

  Modified:src  CHANGES
   src/main http_main.c rfc1413.c
  Log:
  yet more signal race conditions
  
  Revision  ChangesPath
  1.953 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.952
  retrieving revision 1.953
  diff -u -r1.952 -r1.953
  --- CHANGES   1998/07/08 00:46:03 1.952
  +++ CHANGES   1998/07/08 16:54:31 1.953
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.1
   
  +  *) Fix yet another signal-based race condition involving nested timers.
  + Signals suck.  [Dean Gaudet]
  +
 *) suexec's error messages have been clarified a little bit.  [Ken Coar]
   
 *) PORT: Apache is not 8-bit clean in many settings, a problem we're
  
  
  
  1.370 +13 -5 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.369
  retrieving revision 1.370
  diff -u -r1.369 -r1.370
  --- http_main.c   1998/06/29 11:41:48 1.369
  +++ http_main.c   1998/07/08 16:54:34 1.370
  @@ -953,7 +953,13 @@
 */
   
request_rec *log_req = timeout_req;
  + request_rec *save_req = timeout_req;
   
  + /* avoid looping... if ap_log_transaction started another
  +  * timer (say via rfc1413.c) we could loop...
  +  */
  + timeout_req = NULL;
  +
while (log_req->main || log_req->prev) {
/* Get back to original request... */
if (log_req->main)
  @@ -965,8 +971,8 @@
if (!current_conn->keptalive)
ap_log_transaction(log_req);
   
  - ap_bsetflag(timeout_req->connection->client, B_EOUT, 1);
  - ap_bclose(timeout_req->connection->client);
  + ap_bsetflag(save_req->connection->client, B_EOUT, 1);
  + ap_bclose(save_req->connection->client);
   
if (!ap_standalone)
exit(0);
  @@ -975,6 +981,7 @@
   }
   else {   /* abort the connection */
ap_bsetflag(current_conn->client, B_EOUT, 1);
  + ap_bclose(current_conn->client);
current_conn->aborted = 1;
   }
   }
  @@ -1045,9 +1052,11 @@
alarm_expiry_time = time(NULL) + x;
   }
   #else
  -if (x) {
  - alarm_fn = fn;
  +if (alarm_fn && x && fn != alarm_fn) {
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, NULL,
  + "ap_set_callback_and_alarm: possible nested timer!");
   }
  +alarm_fn = fn;
   #ifndef OPTIMIZE_TIMEOUTS
   old = alarm(x);
   #else
  @@ -3390,7 +3399,6 @@
 */
   
ap_kill_timeout(0); /* Cancel any outstanding alarms. */
  - timeout_req = NULL; /* No request in progress */
current_conn = NULL;
   
ap_clear_pool(ptrans);
  
  
  
  1.25  +1 -2  apache-1.3/src/main/rfc1413.c
  
  Index: rfc1413.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/rfc1413.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- rfc1413.c 1998/05/18 21:56:11 1.24
  +++ rfc1413.c 1998/07/08 16:54:34 1.25
  @@ -229,9 +229,8 @@
   
if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user, srv) 
>= 0)
result = user;
  -
  - ap_set_callback_and_alarm(NULL, 0);
   }
  +ap_set_callback_and_alarm(NULL, 0);
   ap_pclosesocket(conn->pool, sock);
   conn->remote_logname = result;
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-29 Thread rse
rse 98/06/29 04:41:50

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Move the initial suEXEC-related startup message from plain fprintf()/stderr to
  a delayed ap_log_error()-based one to avoid problems when Apache is started
  from inetd (instead of standalone). Under this situation startup messages on
  stderr lead to problems (the line is sent to the client in front of the
  requested document).
  
  Now the following occurs in the error_log:
  
  [Mon Jun 29 13:37:38 1998] [notice] Apache/1.3.1-dev (Unix) configured -- 
resuming normal operations
  [Mon Jun 29 13:37:38 1998] [info] Server built: Jun 29 1998 13:37:13
  [Mon Jun 29 13:37:38 1998] [info] suEXEC mechanism enabled (wrapper: 
/tmp/apache/sbin/suexec)
  
  PR: 871, 1318
  
  Revision  ChangesPath
  1.937 +7 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.936
  retrieving revision 1.937
  diff -u -r1.936 -r1.937
  --- CHANGES   1998/06/28 14:43:16 1.936
  +++ CHANGES   1998/06/29 11:41:47 1.937
  @@ -1,5 +1,12 @@
   Changes with Apache 1.3.1
   
  +  *) Move the initial suEXEC-related startup message from plain
  + fprintf()/stderr to a delayed ap_log_error()-based one to avoid problems
  + when Apache is started from inetd (instead of standalone). Under this
  + situation startup messages on stderr lead to problems (the line is sent
  + to the client in front of the requested document).
  + [Ralf S. Engelschall] PR#871, PR#1318
  +
 *) Add a flag so ap_fnmatch() can be used for case-blind pattern matching.
[Ken Coar, Dean Gaudet]
   
  
  
  
  1.369 +4 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.368
  retrieving revision 1.369
  diff -u -r1.368 -r1.369
  --- http_main.c   1998/06/26 21:15:18 1.368
  +++ http_main.c   1998/06/29 11:41:48 1.369
  @@ -2753,7 +2753,6 @@
   
   if ((wrapper.st_mode & S_ISUID) && wrapper.st_uid == 0) {
ap_suexec_enabled = 1;
  - fprintf(stderr, "Configuring Apache for use with suexec wrapper.\n");
   }
   #endif /* ndef WIN32 */
   return (ap_suexec_enabled);
  @@ -4066,6 +4065,10 @@
ap_get_server_version());
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
"Server built: %s", ap_get_server_built());
  + if (ap_suexec_enabled) {
  + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf,
  +  "suEXEC mechanism enabled (wrapper: %s)", SUEXEC_BIN);
  + }
restart_pending = shutdown_pending = 0;
   
while (!restart_pending && !shutdown_pending) {
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-26 Thread ben
ben 98/06/26 14:15:20

  Modified:src/main http_main.c
  Log:
  Make Windoze exit cleanly
  Submitted by: Pierpaolo Fumagalli <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.368 +3 -2  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.367
  retrieving revision 1.368
  diff -u -r1.367 -r1.368
  --- http_main.c   1998/06/25 21:06:03 1.367
  +++ http_main.c   1998/06/26 21:15:18 1.368
  @@ -5063,7 +5063,7 @@
   cleanup_scoreboard();
   
   APD2("process PID %d exited", my_pid);
  -exit(0);
  +clean_parent_exit(0);
   }/* standalone_main */
   
   /* Spawn a child Apache process. The child process has the command
  @@ -5525,7 +5525,8 @@
"Apache", install, run_as_service);
   }
   
  -return (0);
  +clean_parent_exit(0);
  +return 0;/* purely to avoid a warning */
   }
   
   #endif /* ndef MULTITHREAD */
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-25 Thread jim
jim 98/06/25 14:06:05

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Add SIGILL to our dumpable signals
  
  Revision  ChangesPath
  1.933 +2 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.932
  retrieving revision 1.933
  diff -u -r1.932 -r1.933
  --- CHANGES   1998/06/25 19:51:53 1.932
  +++ CHANGES   1998/06/25 21:06:01 1.933
  @@ -1,5 +1,7 @@
   Changes with Apache 1.3.1
   
  +  *) We now attempt to dump core when we get SIGILL. [Jim Jagielski]
  +
 *) PORT: remove broken test for MAP_FILE in http_main.c.
[Wilfredo Sanchez <[EMAIL PROTECTED]>]
   
  
  
  
  1.367 +7 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.366
  retrieving revision 1.367
  diff -u -r1.366 -r1.367
  --- http_main.c   1998/06/25 19:51:55 1.366
  +++ http_main.c   1998/06/25 21:06:03 1.367
  @@ -2546,6 +2546,10 @@
if (sigaction(SIGABRT, &sa, NULL) < 0)
ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGABRT)");
   #endif
  +#ifdef SIGILL
  + if (sigaction(SIGILL, &sa, NULL) < 0)
  + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, 
"sigaction(SIGILL)");
  +#endif
sa.sa_flags = 0;
   }
   sa.sa_handler = sig_term;
  @@ -2586,6 +2590,9 @@
   #ifdef SIGABRT
signal(SIGABRT, sig_coredump);
   #endif /* SIGABRT */
  +#ifdef SIGILL
  + signal(SIGILL, sig_coredump);
  +#endif /* SIGILL */
   #ifdef SIGXCPU
signal(SIGXCPU, SIG_DFL);
   #endif /* SIGXCPU */
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-25 Thread dgaudet
dgaudet 98/06/25 12:51:56

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  remove broken MAP_FILE test
  
  Submitted by: Wilfredo Sanchez <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.932 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.931
  retrieving revision 1.932
  diff -u -r1.931 -r1.932
  --- CHANGES   1998/06/25 19:14:40 1.931
  +++ CHANGES   1998/06/25 19:51:53 1.932
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.1
   
  +  *) PORT: remove broken test for MAP_FILE in http_main.c.
  + [Wilfredo Sanchez <[EMAIL PROTECTED]>]
  +
 *) PORT: Change support/apachectl to use "kill -0 $pid" to test if the
httpd is running.  This should be more portable than figuring out
which of three dozen different versions of "ps" are installed.
  
  
  
  1.366 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.365
  retrieving revision 1.366
  diff -u -r1.365 -r1.366
  --- http_main.c   1998/06/16 03:37:27 1.365
  +++ http_main.c   1998/06/25 19:51:55 1.366
  @@ -1593,7 +1593,7 @@
   {
   caddr_t m;
   
  -#if defined(MAP_ANON) || defined(MAP_FILE)
  +#if defined(MAP_ANON)
   /* BSD style */
   #ifdef CONVEXOS11
   /*
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-10 Thread rse
rse 98/06/10 04:23:13

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Correct initialization of variable `allowed_globals' in http_main.c
  
  Submitted by: Justin Bradford <[EMAIL PROTECTED]>
  Reviewed by: Ralf S. Engelschall
  PR: 2400
  
  Revision  ChangesPath
  1.907 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.906
  retrieving revision 1.907
  diff -u -r1.906 -r1.907
  --- CHANGES   1998/06/10 09:01:58 1.906
  +++ CHANGES   1998/06/10 11:23:10 1.907
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.1
   
  +  *) Correct initialization of variable `allowed_globals' in http_main.c
  + [Justin Bradford <[EMAIL PROTECTED]>] PR#2400
  +
 *) Apache would incorrectly downcase the entire Content-Type passed from
CGIs.  This affected server-push scripts and such which use
multipart/x-mixed-replace;boundary=ThisRandomString.
  
  
  
  1.363 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.362
  retrieving revision 1.363
  diff -u -r1.362 -r1.363
  --- http_main.c   1998/06/08 20:32:16 1.362
  +++ http_main.c   1998/06/10 11:23:11 1.363
  @@ -4484,7 +4484,7 @@
   } globals;
   
   globals allowed_globals =
  -{0, NULL, NULL, NULL, 0};
  +{0, NULL, NULL, NULL, NULL, 0};
   
   /*
* add_job()/remove_job() - add or remove an accepted socket from the
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-08 Thread dgaudet
dgaudet 98/06/08 13:32:18

  Modified:src/main http_main.c
  Log:
  another tiny bit of fallout from the int -> ap_wait_t change.
  
  Submitted by: Dave Dykstra <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.362 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.361
  retrieving revision 1.362
  diff -u -r1.361 -r1.362
  --- http_main.c   1998/06/07 13:16:41 1.361
  +++ http_main.c   1998/06/08 20:32:16 1.362
  @@ -2144,7 +2144,7 @@
kill((pid = ap_scoreboard_image->parent[n].pid), 0) == -1) {
ap_update_child_status(n, SERVER_DEAD, NULL);
/* just mark it as having a successful exit status */
  - *status = 0; 
  + bzero((char *) status, sizeof(ap_wait_t));
return(pid);
}
   }
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-07 Thread ben
ben 98/06/07 06:16:43

  Modified:src  CHANGES
   src/main http_main.c
  Log:
  Make SCO 5 compile again.
  
  Revision  ChangesPath
  1.893 +2 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.892
  retrieving revision 1.893
  diff -u -r1.892 -r1.893
  --- CHANGES   1998/06/06 20:48:51 1.892
  +++ CHANGES   1998/06/07 13:16:40 1.893
  @@ -1,5 +1,7 @@
   Changes with Apache 1.3.1
   
  +  *) PORT: Make SCO 5 (and probably 3) compile again. [Ben Laurie]
  +
 *) PORT: NCR MPRAS systems have the same bug with SIGHUP restart that
Solaris systems experience.  So define WORKAROUND_SOLARIS_BUG.
[Klaus Weber <[EMAIL PROTECTED]>] PR#1973
  
  
  
  1.361 +10 -10apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.360
  retrieving revision 1.361
  diff -u -r1.360 -r1.361
  --- http_main.c   1998/06/06 20:48:54 1.360
  +++ http_main.c   1998/06/07 13:16:41 1.361
  @@ -3242,16 +3242,6 @@
   (void) set42sig();
   #endif
   
  -#ifdef SecureWare
  -if (set_auth_parameters(argc, argv) < 0)
  - perror("set_auth_parameters");
  -if (getluid() < 0)
  - if (setluid(getuid()) < 0)
  - perror("setluid");
  -if (setreuid(0, 0) < 0)
  - perror("setreuid");
  -#endif
  -
   #ifdef WIN32
   /* Initialize the stupid sockets */
   AMCSocketInitialize();
  @@ -4211,6 +4201,16 @@
   int REALMAIN(int argc, char *argv[])
   {
   int c;
  +
  +#ifdef SecureWare
  +if (set_auth_parameters(argc, argv) < 0)
  + perror("set_auth_parameters");
  +if (getluid() < 0)
  + if (setluid(getuid()) < 0)
  + perror("setluid");
  +if (setreuid(0, 0) < 0)
  + perror("setreuid");
  +#endif
   
   #ifdef SOCKS
   SOCKSinit(argv[0]);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-06-06 Thread dgaudet
dgaudet 98/06/06 13:48:55

  Modified:src  CHANGES Configure
   src/main http_main.c
  Log:
  define WORKAROUND_SOLARIS_BUG for NCR systems as well.
  
  PR:   1973
  Submitted by: Klaus Weber <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.892 +4 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.891
  retrieving revision 1.892
  diff -u -r1.891 -r1.892
  --- CHANGES   1998/06/06 19:46:58 1.891
  +++ CHANGES   1998/06/06 20:48:51 1.892
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.1
   
  +  *) PORT: NCR MPRAS systems have the same bug with SIGHUP restart that
  + Solaris systems experience.  So define WORKAROUND_SOLARIS_BUG.
  + [Klaus Weber <[EMAIL PROTECTED]>] PR#1973
  +
 *) Change "Options None" to "Options FollowSymLinks" in the 
 section of the default access.conf-dist
(and -win even though it doesn't matter there).  This has better
  
  
  
  1.264 +6 -0  apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /export/home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.263
  retrieving revision 1.264
  diff -u -r1.263 -r1.264
  --- Configure 1998/06/06 19:30:39 1.263
  +++ Configure 1998/06/06 20:48:52 1.264
  @@ -616,6 +616,12 @@
LIBS="$LIBS -lsocket -lnsl"
DEF_WANTHSREGEX=yes
;;
  +i486-ncr-sysv4)
  + OS='NCR MP/RAS'
  + CFLAGS="$CFLAGS -DSVR4 -DMPRAS"
  + LIBS="$LIBS -lsocket -lnsl -lc -L/usr/ucblib -lucb"
  + DEF_WANTHSREGEX=yes
  + ;;
   *-sysv4*)
OS='SVR4'
CFLAGS="$CFLAGS -DSVR4"
  
  
  
  1.360 +5 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.359
  retrieving revision 1.360
  diff -u -r1.359 -r1.360
  --- http_main.c   1998/06/06 19:30:47 1.359
  +++ http_main.c   1998/06/06 20:48:54 1.360
  @@ -2843,6 +2843,11 @@
   #define WORKAROUND_SOLARIS_BUG
   #endif
   
  +/* PR#1973 NCR SVR4 systems appear to have the same problem */
  +#if defined (MPRAS)
  +#define WORKAROUND_SOLARIS_BUG
  +#endif
  +
   #ifndef WORKAROUND_SOLARIS_BUG
   s = ap_slack(s, AP_SLACK_HIGH);
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c http_protocol.c util.c

1998-06-06 Thread dgaudet
dgaudet 98/06/06 12:30:53

  Modified:src  CHANGES Configure
   src/include conf.h
   src/main http_main.c http_protocol.c util.c
  Log:
  Updated support for UTS 2.1.2.
  
  PR:   2320
  Submitted by: Dave Dykstra <[EMAIL PROTECTED]>
  
  Revision  ChangesPath
  1.890 +3 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.889
  retrieving revision 1.890
  diff -u -r1.889 -r1.890
  --- CHANGES   1998/06/06 19:21:20 1.889
  +++ CHANGES   1998/06/06 19:30:38 1.890
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.1
   
  +  *) PORT: Updated support for UTS 2.1.2.
  + [Dave Dykstra <[EMAIL PROTECTED]>] PR#2320
  +
 *) Fix symbol export list (src/support/httpd.exp) after recent
API changes in the child spawning area.
[Jens-Uwe Mager <[EMAIL PROTECTED]>]
  
  
  
  1.263 +2 -1  apache-1.3/src/Configure
  
  Index: Configure
  ===
  RCS file: /export/home/cvs/apache-1.3/src/Configure,v
  retrieving revision 1.262
  retrieving revision 1.263
  diff -u -r1.262 -r1.263
  --- Configure 1998/06/04 20:13:12 1.262
  +++ Configure 1998/06/06 19:30:39 1.263
  @@ -629,8 +629,9 @@
;;
   *-uts*)
OS='Amdahl UTS'
  - CFLAGS="$CFLAGS -Xa -eft -DUTS21"
  + CFLAGS="$CFLAGS -Xa -eft -DUTS21 -DUSEBCOPY"
LIBS="$LIBS -lsocket -lbsd -la"
  + DEF_WANTHSREGEX=yes
;;
   *-ultrix)
OS='ULTRIX'
  
  
  
  1.215 +12 -1 apache-1.3/src/include/conf.h
  
  Index: conf.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/conf.h,v
  retrieving revision 1.214
  retrieving revision 1.215
  diff -u -r1.214 -r1.215
  --- conf.h1998/06/04 20:13:17 1.214
  +++ conf.h1998/06/06 19:30:46 1.215
  @@ -573,13 +573,24 @@
   #undef NO_KILLPG
   #define NO_SETSID
   #define NEED_WAITPID
  -#define NO_OTHER_CHILD
   #define STDIN_FILENO 0
   #define STDOUT_FILENO 1
   #define STDERR_FILENO 2
   #define HAVE_SYSLOG 1
  +#define USE_LONGJMP
  +#define JMP_BUF jmp_buf
  +#define NO_USE_SIGACTION
  +#define NEED_STRERROR
  +#define NEED_STRSTR
  +#define NEED_HASHBANG_EMUL
  +#define NDELAY_PIPE_RETURNS_ZERO
  +#define NO_DATA NO_ADDRESS
  +#define  ap_wait_t   union wait
  +#define WEXITSTATUS(status)  (int)((status).w_retcode)
  +#define WTERMSIG(status) (int)((status).w_termsig)
   #define strftime(buf,bufsize,fmt,tm)ascftime(buf,fmt,tm)
   #include 
  +#include  
   
   #elif defined(APOLLO)
   #undef HAVE_GMTOFF
  
  
  
  1.359 +17 -15apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.358
  retrieving revision 1.359
  diff -u -r1.358 -r1.359
  --- http_main.c   1998/06/04 20:13:19 1.358
  +++ http_main.c   1998/06/06 19:30:47 1.359
  @@ -2129,29 +2129,26 @@
   }
   
   
  -#if defined(BROKEN_WAIT) || defined(NEED_WAITPID)
  +#if defined(NEED_WAITPID)
   /*
  -   Some systems appear to fail to deliver dead children to wait() at times.
  -   This sorts them out. In fact, this may have been caused by a race 
condition
  -   in wait_or_timeout(). But this routine is still useful for systems with no
  -   waitpid().
  +   Systems without a real waitpid sometimes lose a child's exit while waiting
  +   for another.  Search through the scoreboard for missing children.
*/
  -int reap_children(void)
  +int reap_children(ap_wait_t *status)
   {
  -int status, n;
  -int ret = 0;
  +int n, pid;
   
   for (n = 0; n < max_daemons_limit; ++n) {
  - if (ap_scoreboard_image->servers[n].status != SERVER_DEAD
  - && waitpid(ap_scoreboard_image->parent[n].pid, &status, WNOHANG)
  - == -1
  - && errno == ECHILD) {
  - ap_sync_scoreboard_image();
  +ap_sync_scoreboard_image();
  + if (ap_scoreboard_image->servers[n].status != SERVER_DEAD &&
  + kill((pid = ap_scoreboard_image->parent[n].pid), 0) == -1) {
ap_update_child_status(n, SERVER_DEAD, NULL);
  - ret = 1;
  + /* just mark it as having a successful exit status */
  + *status = 0; 
  + return(pid);
}
   }
  -return ret;
  +return 0;
   }
   #endif
   
  @@ -2214,6 +2211,11 @@
   if (ret > 0) {
return ret;
   }
  +#ifdef NEED_WAITPID
  +if ((ret = reap_children(status)) > 0) {
  + return ret;
  +}
  +#endif
   tv.tv_sec = SCOREBOARD_MAINTENANCE_INTERVAL / 100;
   tv.tv_usec = SCOREBOARD_MAINTENANCE_INTERVAL % 100;
   ap_select(0, NULL, NULL, NULL, &tv);
  
  
  
  1.218 

cvs commit: apache-1.3/src/main http_main.c

1998-05-29 Thread brian
brian   98/05/28 17:16:03

  Modified:src  CHANGES
   src/include conf.h httpd.h
   src/main http_main.c
  Log:
  various OS/2 cleanups.
  
  Revision  ChangesPath
  1.873 +2 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.872
  retrieving revision 1.873
  diff -u -r1.872 -r1.873
  --- CHANGES   1998/05/28 23:59:33 1.872
  +++ CHANGES   1998/05/29 00:15:51 1.873
  @@ -1,5 +1,7 @@
   Changes with Apache 1.3b8
   
  +  *) Various OS/2 cleanups ["Brian Havard" <[EMAIL PROTECTED]>]
  +
 *) PORT: QNX needed a #include ; and now it uses flock
serialized accept to handle multiple sockets.
[Rob Saccoccio <[EMAIL PROTECTED]>] PR#2295, 2296
  
  
  
  1.212 +1 -0  apache-1.3/src/include/conf.h
  
  Index: conf.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/conf.h,v
  retrieving revision 1.211
  retrieving revision 1.212
  diff -u -r1.211 -r1.212
  --- conf.h1998/05/28 23:59:39 1.211
  +++ conf.h1998/05/29 00:15:56 1.212
  @@ -679,6 +679,7 @@
   #define MAXSOCKETS 4096
   #define USE_OS2_SCOREBOARD
   #define NO_RELIABLE_PIPED_LOGS
  +#define HAVE_SYS_SELECT_H 1
   
   #elif defined(__MACHTEN__)
   typedef int rlim_t;
  
  
  
  1.218 +3 -0  apache-1.3/src/include/httpd.h
  
  Index: httpd.h
  ===
  RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v
  retrieving revision 1.217
  retrieving revision 1.218
  diff -u -r1.217 -r1.218
  --- httpd.h   1998/05/28 19:57:07 1.217
  +++ httpd.h   1998/05/29 00:15:56 1.218
  @@ -887,6 +887,9 @@
   API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp);
   API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
   API_EXPORT(char *) ap_uudecode(pool *, const char *);
  +#ifdef __EMX__
  +void os2pathname(char *path);
  +#endif
   
   API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source,
   size_t nmatch, regmatch_t pmatch[]);
  
  
  
  1.356 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.355
  retrieving revision 1.356
  diff -u -r1.355 -r1.356
  --- http_main.c   1998/05/28 23:59:35 1.355
  +++ http_main.c   1998/05/29 00:15:59 1.356
  @@ -189,6 +189,7 @@
   #ifdef USE_OS2_SCOREBOARD
   /* Add MMAP style functionality to OS/2 */
   #define INCL_DOSMEMMGR
  +#define INCL_DOSEXCEPTIONS
   #include 
   #include 
   #include 
  @@ -1485,7 +1486,6 @@
   {
   caddr_t m;
   
  -char errstr[MAX_STRING_LEN];
   int rc;
   
   m = (caddr_t) create_shared_heap("\\SHAREMEM\\SCOREBOARD", 
SCOREBOARD_SIZE);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-21 Thread brian
brian   98/05/20 21:07:23

  Modified:src  CHANGES
   htdocs/manual/mod core.html
   src/main http_main.c
  Log:
  PR: 2099
  
  Don't commit suicide.
  
  Revision  ChangesPath
  1.857 +2 -0  apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===
  RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.856
  retrieving revision 1.857
  diff -u -r1.856 -r1.857
  --- CHANGES   1998/05/21 03:37:22 1.856
  +++ CHANGES   1998/05/21 04:07:11 1.857
  @@ -1,5 +1,7 @@
   Changes with Apache 1.3b7
   
  +  *) Ignore MaxRequestsPerChild on WIN32. [Brian Behlendorf]
  +
 *) Fix discrepancy in proxy_ftp.c which was causing failures when 
trying to connect to certain ftpd's, such as anonftpd.  
[Rick Ohnemus <[EMAIL PROTECTED]>]
  
  
  
  1.121 +5 -1  apache-1.3/htdocs/manual/mod/core.html
  
  Index: core.html
  ===
  RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/core.html,v
  retrieving revision 1.120
  retrieving revision 1.121
  diff -u -r1.120 -r1.121
  --- core.html 1998/05/20 18:40:35 1.120
  +++ core.html 1998/05/21 04:07:17 1.121
  @@ -1675,7 +1675,11 @@
   memory leakage;
by giving processes a finite lifetime, it helps reduce the
   number of processes when the server load reduces.
  -
  +
  +
  +This directive has no effect on Win32.
  +
  +
   
   MaxSpareServers directive
   
  
  
  
  1.354 +4 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.353
  retrieving revision 1.354
  diff -u -r1.353 -r1.354
  --- http_main.c   1998/05/14 21:58:26 1.353
  +++ http_main.c   1998/05/21 04:07:21 1.354
  @@ -3393,10 +3393,14 @@
clean_child_exit(0);
}
   
  +#ifndef WIN32
if ((ap_max_requests_per_child > 0
 && ++requests_this_child >= ap_max_requests_per_child)) {
clean_child_exit(0);
}
  +#else
  + ++requests_this_child;
  +#endif
   
(void) ap_update_child_status(my_child_num, SERVER_READY, (request_rec 
*) NULL);
   
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-14 Thread martin
martin  98/05/14 14:58:27

  Modified:src/main http_main.c
  Log:
  Hide the password (for ftp://user:[EMAIL PROTECTED]/ requests)
  from the request list displayed by mod_status. This is analogous to
  the hiding in mod_log_config.
  
  Revision  ChangesPath
  1.353 +11 -2 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.352
  retrieving revision 1.353
  diff -u -u -r1.352 -r1.353
  --- http_main.c   1998/05/13 15:20:02 1.352
  +++ http_main.c   1998/05/14 21:58:26 1.353
  @@ -1902,8 +1902,17 @@
conn_rec *c = r->connection;
ap_cpystrn(ss->client, ap_get_remote_host(c, r->per_dir_config,
  REMOTE_NOLOOKUP), sizeof(ss->client));
  - ap_cpystrn(ss->request, (r->the_request ? r->the_request :
  -   "NULL"), sizeof(ss->request));
  +if (r->the_request == NULL) {
  + ap_cpystrn(ss->request, "NULL", sizeof(ss->request));
  + } else if (r->parsed_uri.password == NULL) {
  + ap_cpystrn(ss->request, r->the_request, sizeof(ss->request));
  + } else {
  + /* Don't reveal the password in the server-status view */
  + ap_cpystrn(ss->request, ap_pstrcat(r->pool, r->method, " ",
  +ap_unparse_uri_components(r->pool, 
&r->parsed_uri, UNP_OMITPASSWORD),
  +r->assbackwards ? NULL : " ", 
r->protocol, NULL),
  +sizeof(ss->request));
  + }
ap_cpystrn(ss->vhost, r->server->server_hostname, sizeof(ss->vhost));
   }
   #endif
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-13 Thread martin
martin  98/05/13 08:20:04

  Modified:src/main http_main.c
  Log:
  Propagated child errors don't set errno
  
  Revision  ChangesPath
  1.352 +1 -1  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.351
  retrieving revision 1.352
  diff -u -u -r1.351 -r1.352
  --- http_main.c   1998/05/11 20:08:08 1.351
  +++ http_main.c   1998/05/13 15:20:02 1.352
  @@ -3907,7 +3907,7 @@
*/
   if ((WIFEXITED(status)) &&
WEXITSTATUS(status) == APEXIT_CHILDFATAL) {
  - ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf,
  + ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, server_conf,
"Child %d returned a Fatal error... \n"
"Apache is exiting!",
pid);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread martin
martin  98/05/09 16:48:04

  Modified:src/main http_main.c
  Log:
  Define a "apache private" signal names list if the OS does not have one.
  Note: Currently, this list is initialized at run-time.
  Additionally, check valid range of siglist array in sig_coredump() routine.
  
  Reviewed by:  Jim Jagielski, Dean Gaudet
  
  Revision  ChangesPath
  1.350 +135 -1apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.349
  retrieving revision 1.350
  diff -u -u -r1.349 -r1.350
  --- http_main.c   1998/05/09 18:49:33 1.349
  +++ http_main.c   1998/05/09 23:48:02 1.350
  @@ -2206,6 +2206,138 @@
   }
   
   
  +#if defined(NSIG)
  +#define NumSIG NSIG
  +#elif defined(_NSIG)
  +#define NumSIG _NSIG
  +#elif defined(__NSIG)
  +#define NumSIG __NSIG
  +#else
  +#define NumSIG 32   /* for 1998's unixes, this is still a good assumption */
  +#endif
  +
  +#ifdef SYS_SIGLIST /* platform has sys_siglist[] */
  +#define INIT_SIGLIST()  /*nothing*/
  +#else /* platform has no sys_siglist[], define our own */
  +#define SYS_SIGLIST ap_sys_siglist
  +#define INIT_SIGLIST() siglist_init();
  +
  +const char *ap_sys_siglist[NumSIG];
  +
  +static void siglist_init(void)
  +{
  +int sig;
  +
  +ap_sys_siglist[0] = "Signal 0";
  +#ifdef SIGHUP
  +ap_sys_siglist[SIGHUP] = "Hangup";
  +#endif
  +#ifdef SIGINT
  +ap_sys_siglist[SIGINT] = "Interrupt";
  +#endif
  +#ifdef SIGQUIT
  +ap_sys_siglist[SIGQUIT] = "Quit";
  +#endif
  +#ifdef SIGILL
  +ap_sys_siglist[SIGILL] = "Illegal instruction";
  +#endif
  +#ifdef SIGTRAP
  +ap_sys_siglist[SIGTRAP] = "Trace/BPT trap";
  +#endif
  +#ifdef SIGIOT
  +ap_sys_siglist[SIGIOT] = "IOT instruction";
  +#endif
  +#ifdef SIGABRT
  +ap_sys_siglist[SIGABRT] = "Abort";
  +#endif
  +#ifdef SIGEMT
  +ap_sys_siglist[SIGEMT] = "Emulator trap";
  +#endif
  +#ifdef SIGFPE
  +ap_sys_siglist[SIGFPE] = "Arithmetic exception";
  +#endif
  +#ifdef SIGKILL
  +ap_sys_siglist[SIGKILL] = "Killed";
  +#endif
  +#ifdef SIGBUS
  +ap_sys_siglist[SIGBUS] = "Bus error";
  +#endif
  +#ifdef SIGSEGV
  +ap_sys_siglist[SIGSEGV] = "Segmentation fault";
  +#endif
  +#ifdef SIGSYS
  +ap_sys_siglist[SIGSYS] = "Bad system call";
  +#endif
  +#ifdef SIGPIPE
  +ap_sys_siglist[SIGPIPE] = "Broken pipe";
  +#endif
  +#ifdef SIGALRM
  +ap_sys_siglist[SIGALRM] = "Alarm clock";
  +#endif
  +#ifdef SIGTERM
  +ap_sys_siglist[SIGTERM] = "Terminated";
  +#endif
  +#ifdef SIGUSR1
  +ap_sys_siglist[SIGUSR1] = "User defined signal 1";
  +#endif
  +#ifdef SIGUSR2
  +ap_sys_siglist[SIGUSR2] = "User defined signal 2";
  +#endif
  +#ifdef SIGCLD
  +ap_sys_siglist[SIGCLD] = "Child status change";
  +#endif
  +#ifdef SIGCHLD
  +ap_sys_siglist[SIGCHLD] = "Child status change";
  +#endif
  +#ifdef SIGPWR
  +ap_sys_siglist[SIGPWR] = "Power-fail restart";
  +#endif
  +#ifdef SIGWINCH
  +ap_sys_siglist[SIGWINCH] = "Window changed";
  +#endif
  +#ifdef SIGURG
  +ap_sys_siglist[SIGURG] = "urgent socket condition";
  +#endif
  +#ifdef SIGPOLL
  +ap_sys_siglist[SIGPOLL] = "Pollable event occurred";
  +#endif
  +#ifdef SIGIO
  +ap_sys_siglist[SIGIO] = "socket I/O possible";
  +#endif
  +#ifdef SIGSTOP
  +ap_sys_siglist[SIGSTOP] = "Stopped (signal)";
  +#endif
  +#ifdef SIGTSTP
  +ap_sys_siglist[SIGTSTP] = "Stopped";
  +#endif
  +#ifdef SIGCONT
  +ap_sys_siglist[SIGCONT] = "Continued";
  +#endif
  +#ifdef SIGTTIN
  +ap_sys_siglist[SIGTTIN] = "Stopped (tty input)";
  +#endif
  +#ifdef SIGTTOU
  +ap_sys_siglist[SIGTTOU] = "Stopped (tty output)";
  +#endif
  +#ifdef SIGVTALRM
  +ap_sys_siglist[SIGVTALRM] = "virtual timer expired";
  +#endif
  +#ifdef SIGPROF
  +ap_sys_siglist[SIGPROF] = "profiling timer expired";
  +#endif
  +#ifdef SIGXCPU
  +ap_sys_siglist[SIGXCPU] = "exceeded cpu limit";
  +#endif
  +#ifdef SIGXFSZ
  +ap_sys_siglist[SIGXFSZ] = "exceeded file size limit";
  +#endif
  +for (sig=0; sig < sizeof(ap_sys_siglist)/sizeof(ap_sys_siglist[0]); 
++sig)
  +if (ap_sys_siglist[sig] == NULL)
  +ap_sys_siglist[sig] = "";
  +}
  +#endif /* platform has sys_siglist[] */
  +
  +
   /* handle all varieties of core dumping signals */
   static void sig_coredump(int sig)
   {
  @@ -3086,6 +3218,7 @@
*/
   static void common_init(void)
   {
  +INIT_SIGLIST()
   #ifdef AUX3
   (void) set42sig();
   #endif
  @@ -3793,7 +3926,8 @@
server_conf,
"httpd: child pid %d exit signal %s (%d), "
"possible coredump in %s",
  - pid, SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
  + pid, (WTERMSIG(status) >= NumSIG) ? "" : 
  + SYS_SIGLIST[WTERMSIG(status)], WTERMSIG(status),
ap_co

cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread pcs
pcs 98/05/09 11:49:35

  Modified:src/main http_main.c
  Log:
  The PID file on Win32 contained the PID of the most recently created
  child process, not the parent.
  
  Revision  ChangesPath
  1.349 +3 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.348
  retrieving revision 1.349
  diff -u -r1.348 -r1.349
  --- http_main.c   1998/05/09 15:56:23 1.348
  +++ http_main.c   1998/05/09 18:49:33 1.349
  @@ -5285,7 +5285,9 @@
   }
   
   server_conf = ap_read_config(pconf, ptrans, ap_server_confname);
  -ap_log_pid(pconf, ap_pid_fname);
  +if (!child) {
  + ap_log_pid(pconf, ap_pid_fname);
  +}
   ap_init_modules(pconf, server_conf);
   ap_suexec_enabled = init_suexec();
   ap_set_version();
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread ben
ben 98/05/09 08:56:27

  Modified:src/main http_main.c
  Log:
  Fix a warning.
  
  Revision  ChangesPath
  1.348 +1 -1  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.347
  retrieving revision 1.348
  diff -u -r1.347 -r1.348
  --- http_main.c   1998/05/09 15:54:38 1.347
  +++ http_main.c   1998/05/09 15:56:23 1.348
  @@ -859,7 +859,7 @@
   static void usage(char *bin)
   {
   char pad[MAX_STRING_LEN];
  -int i;
  +unsigned i;
   
   for (i = 0; i < strlen(bin); i++)
pad[i] = ' ';
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread ben
ben 98/05/09 08:54:40

  Modified:src/main http_main.c
  Log:
  Report server version correctly on Win32.
  
  Revision  ChangesPath
  1.347 +10 -8 apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.346
  retrieving revision 1.347
  diff -u -r1.346 -r1.347
  --- http_main.c   1998/05/09 15:49:34 1.346
  +++ http_main.c   1998/05/09 15:54:38 1.347
  @@ -5259,6 +5259,7 @@
ap_cpystrn(ap_server_confname, ap_os_canonical_filename(pconf, 
optarg), sizeof(ap_server_confname));
break;
case 'v':
  + ap_set_version();
printf("Server version: %s\n", ap_get_server_version());
printf("Server built:   %s\n", ap_get_server_built());
exit(0);
  @@ -5279,14 +5280,6 @@
}
   }
   
  -#ifdef __EMX__
  -printf("%s \n", ap_get_server_version());
  -#endif
  -#ifdef WIN32
  -if (!child) {
  - printf("%s \n", ap_get_server_version());
  -}
  -#endif
   if (!child && run_as_service) {
service_cd();
   }
  @@ -5298,6 +5291,15 @@
   ap_set_version();
   ap_open_logs(server_conf, pconf);
   set_group_privs();
  +
  +#ifdef __EMX__
  +printf("%s \n", ap_get_server_version());
  +#endif
  +#ifdef WIN32
  +if (!child) {
  + printf("%s \n", ap_get_server_version());
  +}
  +#endif
   
   if (one_process && !exit_event)
exit_event = create_event(0, 0, NULL);
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread pcs
pcs 98/05/09 08:26:31

  Modified:src/main http_main.c
  Log:
  Start cleaning up the Win32 code. This cleans up the code which spawns
  child processes. The changes are
  
   -- remove an unbounded sprintf()
   -- always check for errors at all stages, and log an error message
   -- if an error occurs in creating a child, die, but make sure
  all already created children a killed correctly
   -- remove assert()'s
  
  Revision  ChangesPath
  1.345 +64 -13apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.344
  retrieving revision 1.345
  diff -u -r1.344 -r1.345
  --- http_main.c   1998/05/09 13:23:56 1.344
  +++ http_main.c   1998/05/09 15:26:29 1.345
  @@ -4882,20 +4882,40 @@
   exit(0);
   }/* standalone_main */
   
  +/* Spawn a child Apache process. The child process has the command
  + * line arguments from argc and argv[], plus a -Z argument giving the
  + * name of an event. The child should open and poll or wait on this
  + * event. When it is signalled, the child should die.  prefix is a
  + * prefix string for the event name.
  + * 
  + * The child_num argument on entry contains a serial number for this
  + * child (used to create a unique event name). On exit, this number
  + * will have been incremented by one, ready for the next call.
  + *
  + * On exit, the value pointed to be *ev will contain the event created
  + * to signal the new child process.
  + *
  + * The return value is the handle to the child process if successful,
  + * else -1. If -1 is returned the error will already have been logged
  + * by ap_log_error(). 
  + */
   
   int create_event_and_spawn(int argc, char **argv, event **ev, int 
*child_num, char *prefix)
   {
  -int pid = getpid();
   char buf[40], mod[200];
   int i, rv;
   char **pass_argv = (char **) alloca(sizeof(char *) * (argc + 3));
   
  -sprintf(buf, "%s_%d", prefix, ++(*child_num));
  +ap_snprintf(buf, sizeof(buf), "%s_%d", prefix, ++(*child_num));
   _flushall();
   *ev = CreateEvent(NULL, TRUE, FALSE, buf);
  +if (!*ev) {
  + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL,
  + "could not create event for child process");
  + return -1;
  +}
   APD2("create_event_and_spawn(): created process kill event %s", buf);
   
  -ap_assert(*ev);
   pass_argv[0] = argv[0];
   pass_argv[1] = "-Z";
   pass_argv[2] = buf;
  @@ -4903,12 +4923,27 @@
pass_argv[i + 2] = argv[i];
   }
   pass_argv[argc + 2] = NULL;
  -
   
  -GetModuleFileName(NULL, mod, 200);
  +rv = GetModuleFileName(NULL, mod, sizeof(mod));
  +if (rv == sizeof(mod)) {
  + /* mod[] was not big enough for our pathname */
  + ap_log_error(APLOG_MARK, APLOG_ERR, NULL,
  + "Internal error: path to Apache process too long");
  + return -1;
  +}
  +if (rv == 0) {
  + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL,
  + "GetModuleFileName() for current process");
  + return -1;
  +}
   rv = spawnv(_P_NOWAIT, mod, pass_argv);
  +if (rv == -1) {
  + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL,
  + "spawn of child process %s failed", mod);
  + return -1;
  +}
   
  -return (rv);
  +return rv;
   }
   
   /**
  @@ -4941,18 +4976,24 @@
   APD4("cleanup_processes: removed child in slot %d handle %d, max=%d", 
position, handle, *processes);
   }
   
  -void create_process(HANDLE *handles, HANDLE *events, int *processes, int 
*child_num, char *kill_event_name, int argc, char **argv)
  +int create_process(HANDLE *handles, HANDLE *events, int *processes, int 
*child_num, char *kill_event_name, int argc, char **argv)
   {
   int i = *processes;
   HANDLE kill_event;
  +int child_handle;
   
  -handles[i] = (HANDLE)create_event_and_spawn(argc, argv, &kill_event, 
child_num, kill_event_name);
  -ap_assert(handles[i] >= 0);
  +child_handle = create_event_and_spawn(argc, argv, &kill_event, 
child_num, kill_event_name);
  +if (child_handle <= 0) {
  + return -1;
  +}
  +handles[i] = (HANDLE)child_handle;
   events[i] = kill_event;
   (*processes)++;
   
   APD4("create_processes: created child in slot %d handle %d, max=%d", 
(*processes)-1, handles[(*processes)-1], *processes);
  +
  +return 0;
   }
   
   int master_main(int argc, char **argv)
  @@ -4970,7 +5011,7 @@
   HANDLE process_kill_events[MAX_PROCESSES];
   int current_live_processes = 0; /* number of child process we know about 
*/
   int processes_to_create = 0;/* number of child processes to create */
  -pool *pparent;  /* pool for the parent process. Cleaned o

cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread pcs
pcs 98/05/09 06:23:58

  Modified:src/main http_main.c
  Log:
  Win32 does not have kill(). Use raise() instead.
  
  Revision  ChangesPath
  1.344 +4 -0  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.343
  retrieving revision 1.344
  diff -u -r1.343 -r1.344
  --- http_main.c   1998/05/09 04:42:28 1.343
  +++ http_main.c   1998/05/09 13:23:56 1.344
  @@ -2211,7 +2211,11 @@
   {
   chdir(ap_coredump_dir);
   signal(sig, SIG_DFL);
  +#ifndef WIN32
   kill(getpid(), sig);
  +#else
  +raise(sig);
  +#endif
   /* At this point we've got sig blocked, because we're still inside
* the signal handler.  When we leave the signal handler it will
* be unblocked, and we'll take the signal... and coredump or whatever
  
  
  


cvs commit: apache-1.3/src/main http_main.c

1998-05-09 Thread coar
coar98/05/08 21:36:40

  Modified:src/main http_main.c
  Log:
Untangle the last patch..  ap_add_version_component() needs to
*prepend* the strings it's fed, not append them.  This is because
the last thing that calls it before the string is locked is
ap_set_version() (as in set-like-cement), which adds the
SERVER_BASEVERSION, the platform (conditionally), and the
SERVER_SUBVERSION (if defined) at a known location - the front
of the string.
  
This has the drawback that module contributions will be listed
in reverse order from their 'importance' (which is, in turn,
in reverse order from their appearance in the Configuration
file ;-).  However, only modules with major effects should be
contributing to the string anyway, so we can consider them
equal.  Can't we?
  
The alternative is to either allow ap_set_version() to directly
modify the string rather than going through ap_add...(), or else
to add another routine that appends rather than prepends.  I
don't like either of these because of the issues with semantics
synchronisation and code duplication.
  
The last patch confused things, though, so I'm just returning the
behaviour to the original design - if someone wants to take
extra steps to have module contributions listed in the same
order as they're called, have a party.
  
This should fix Rasmus' problem with the components being out
of order, although it doesn't touch his issue with the init
callback duplicating the SERVER_SUBVERSION effort.
  
  Revision  ChangesPath
  1.342 +6 -6  apache-1.3/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v
  retrieving revision 1.341
  retrieving revision 1.342
  diff -u -r1.341 -r1.342
  --- http_main.c   1998/05/09 03:25:43 1.341
  +++ http_main.c   1998/05/09 04:36:38 1.342
  @@ -371,15 +371,15 @@
*/
   if (server_version == NULL) {
ap_register_cleanup(pconf, NULL, (void (*)(void *))reset_version, 
  - (void (*)(void *))ap_null_cleanup);
  + ap_null_cleanup);
server_version = ap_pstrdup(pconf, component);
}
else {
/*
 * Prepend the given component identifier to the existing string
 */
  - server_version = ap_pstrcat(pconf, server_version, " ", component,
  - NULL);
  + server_version = ap_pstrcat(pconf, component, " ", server_version,
  + NULL);
}
   }
   }
  @@ -390,15 +390,15 @@
*/
   static void ap_set_version()
   {
  +#ifdef SERVER_SUBVERSION
  +ap_add_version_component(SERVER_SUBVERSION);
  +#endif
   if (ap_note_platform) {
   ap_add_version_component(SERVER_BASEVERSION " (" PLATFORM ")");
   }
   else {
   ap_add_version_component(SERVER_BASEVERSION);
   }
  -#ifdef SERVER_SUBVERSION
  -ap_add_version_component(SERVER_SUBVERSION);
  -#endif
   version_locked++;
   }
   
  
  
  


  1   2   >