cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread mpmt_pthread.c scoreboard.c

2000-02-14 Thread rbb
rbb 00/02/14 14:20:36

  Modified:src/modules/mpm/mpmt_pthread mpmt_pthread.c scoreboard.c
  Log:
  Port the scoreboard from the mpmt_pthread MPM to use APR's shared memory.
  Tested on Linux, but it could use testing on other platforms.
  
  Revision  ChangesPath
  1.55  +1 -1  apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- mpmt_pthread.c2000/01/19 01:15:42 1.54
  +++ mpmt_pthread.c2000/02/14 22:20:34 1.55
  @@ -84,7 +84,7 @@
   int ap_threads_per_child=0; /* Worker threads per child */
   int ap_max_requests_per_child=0;
   static char *ap_pid_fname=NULL;
  -static char *ap_scoreboard_fname=NULL;
  +API_VAR_EXPORT char *ap_scoreboard_fname=NULL;
   static int ap_daemons_to_start=0;
   static int min_spare_threads=0;
   static int max_spare_threads=0;
  
  
  
  1.15  +26 -426   apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.c
  
  Index: scoreboard.c
  ===
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/scoreboard.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- scoreboard.c  2000/01/19 01:15:42 1.14
  +++ scoreboard.c  2000/02/14 22:20:34 1.15
  @@ -10,25 +10,9 @@
   #include "mpmt_pthread.h"
   #include "scoreboard.h"
   #include 
  -#ifdef USE_SHMGET_SCOREBOARD
  -#include 
  -#include 
  -#endif
  -
  -#ifdef USE_OS2_SCOREBOARD
  -/* Add MMAP style functionality to OS/2 */
  -#define INCL_DOSMEMMGR
  -#define INCL_DOSEXCEPTIONS
  -#define INCL_DOSSEMAPHORES
  -#include 
  -#include 
  -#include 
  -caddr_t create_shared_heap(const char *, size_t);
  -caddr_t get_shared_heap(const char *);
  -#endif
   
   scoreboard *ap_scoreboard_image = NULL;
  -
  +API_VAR_IMPORT char *ap_scoreboard_fname;
   /*
*
* Dealing with the scoreboard... a lot of these variables are global
  @@ -70,438 +54,58 @@
   
   
   #else /* MULTITHREAD */
  -#if defined(USE_OS2_SCOREBOARD)
  -
  -/* The next two routines are used to access shared memory under OS/2.  */
  -/* This requires EMX v09c to be installed.   */
  -
  -caddr_t create_shared_heap(const char *name, size_t size)
  -{
  -ULONG rc;
  -void *mem;
  -Heap_t h;
  -
  -rc = DosAllocSharedMem(&mem, name, size,
  -PAG_COMMIT | PAG_READ | PAG_WRITE);
  -if (rc != 0)
  - return NULL;
  -h = _ucreate(mem, size, !_BLOCK_CLEAN, _HEAP_REGULAR | _HEAP_SHARED,
  -  NULL, NULL);
  -if (h == NULL)
  - DosFreeMem(mem);
  -return (caddr_t) h;
  -}
  -
  -caddr_t get_shared_heap(const char *Name)
  -{
  -
  -PVOID BaseAddress;   /* Pointer to the base address of
  -the shared memory object */
  -ULONG AttributeFlags;/* Flags describing characteristics
  -of the shared memory object */
  -APIRET rc;   /* Return code */
  -
  -/* Request read and write access to */
  -/*   the shared memory object   */
  -AttributeFlags = PAG_WRITE | PAG_READ;
  -
  -rc = DosGetNamedSharedMem(&BaseAddress, Name, AttributeFlags);
  -
  -if (rc != 0) {
  - printf("DosGetNamedSharedMem error: return code = %ld", rc);
  - return 0;
  -}
  -
  -return BaseAddress;
  -}
  -
  -static void setup_shared_mem(ap_context_t *p)
  -{
  -caddr_t m;
  -
  -int rc;
  -
  -m = (caddr_t) create_shared_heap("\\SHAREMEM\\SCOREBOARD", 
SCOREBOARD_SIZE);
  -if (m == 0) {
  - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
  - "%s: Could not create OS/2 Shared memory pool.",
  -  ap_server_argv0);
  - exit(APEXIT_INIT);
  -}
  -
  -rc = _uopen((Heap_t) m);
  -if (rc != 0) {
  - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
  - "%s: Could not uopen() newly created OS/2 Shared memory pool.",
  - ap_server_argv0);
  -}
  -ap_scoreboard_image = (scoreboard *) m;
  -ap_scoreboard_image->global.running_generation = 0;
  -}
  -
  -API_EXPORT(void) reopen_scoreboard(ap_context_t *p)
  -{
  -caddr_t m;
  -int rc;
  -
  -m = (caddr_t) get_shared_heap("\\SHAREMEM\\SCOREBOARD");
  -if (m == 0) {
  - ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
  - "%s: Could not find existing OS/2 Shared memory pool.",
  -  ap_server_argv0);
  - exit(APEXIT_INIT);
  -}
  -
  -rc = _uopen((Heap_t) m);
  -ap_scoreboard_image = (scoreboard *) m;

cvs commit: apache-2.0/src/os/win32 main_win32.c

2000-02-14 Thread stoddard
stoddard00/02/14 14:01:11

  Modified:src/main http_main.c
   src/modules/mpm/winnt winnt.c
   src/os/win32 main_win32.c
  Log:
  Rework the code to handle apache -k shutdown|restart. The fundamental problem
  being solved here is determining the best way to discover the Apache
  parent process PID (stored in the location specified by the PidFile 
directive).
  This patch attempts to read the config file directly to determine the
  pidfile and avoids going through the motions of calling all the module 
initialization
  routines.
  
  This patch will not work if the pidfile directive is in a file pointed to by
  an include directive. Not sure is this is a common case or not on Windows.
  If it is, it is easy enough to add a bit more code to follow include
  directives. An interesting modification would be to detect the presence of a \
  -C directive containing a pointer to the pidfile: E.g.,
  apache -k restart -C "pidfile d:/mypidfile". Let's keep it simple for now and
  see what happens.
  
  Revision  ChangesPath
  1.29  +0 -15 apache-2.0/src/main/http_main.c
  
  Index: http_main.c
  ===
  RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- http_main.c   2000/02/03 19:38:08 1.28
  +++ http_main.c   2000/02/14 22:01:04 1.29
  @@ -298,10 +298,6 @@
   ap_context_t *ptemp; /* Pool for temporary config stuff, reset often */
   ap_context_t *pcommands; /* Pool for -C and -c switches */
   
  -#ifdef WIN32
  -char *signal = NULL;
  -#endif
  -
   ap_server_argv0 = process->short_name;
   
   ap_util_uri_init();
  @@ -334,11 +330,6 @@
case 'f':
confname = ap_optarg;
break;
  -#ifdef WIN32
  -case 'k':
  - signal = ap_optarg;
  -break;
  -#endif
case 'v':
printf("Server version: %s\n", ap_get_server_version());
printf("Server built:   %s\n", ap_get_server_built());
  @@ -377,12 +368,6 @@
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, 
"Syntax OK\n");
destroy_and_exit_process(process, 0);
   }
  -#ifdef WIN32
  -if (signal) {
  -ap_signal_parent(pconf, signal, ap_server_root);
  -destroy_and_exit_process(process, 0);
  -}
  -#endif
   ap_clear_pool(plog);
   ap_run_open_logs(pconf, plog, ptemp, server_conf);
   ap_post_config_hook(pconf, plog, ptemp, server_conf);
  
  
  
  1.39  +0 -55 apache-2.0/src/modules/mpm/winnt/winnt.c
  
  Index: winnt.c
  ===
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/winnt.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- winnt.c   2000/02/14 14:28:16 1.38
  +++ winnt.c   2000/02/14 22:01:08 1.39
  @@ -359,61 +359,6 @@
   {
   signal_parent(0);
   }
  -
  -void ap_signal_parent(ap_context_t *p, const char* signal, 
  -  const char* server_root) 
  -{
  -HANDLE event;
  -char prefix[20];
  -char *EventName;
  -FILE *fp;
  -int nread;
  -char *fname;
  -int end;
  -
  -printf("signal = %s\n", signal);
  -
  -fname = ap_server_root_relative (p, ap_pid_fname);
  -
  -fp = fopen(fname, "r");
  -if (!fp) {
  - printf("Cannot read apache PID file %s. Error = %d\n", fname, errno);
  -return;
  -}
  -prefix[0] = 'a';
  -prefix[1] = 'p';
  -
  -nread = fread(prefix+2, 1, sizeof(prefix)-3, fp);
  -if (nread == 0) {
  - fclose(fp);
  - printf("PID file %s was empty\n", fname);
  -return;
  -}
  -fclose(fp);
  -
  -/* Terminate the prefix string */
  -end = 2 + nread - 1;
  -while (end > 0 && (prefix[end] == '\r' || prefix[end] == '\n'))
  - end--;
  -prefix[end + 1] = '\0';
  -
  -/* Build the event name. Should be one of the following...
  - * apPID_shutdown
  - * apPID_restart
  - */
  -EventName = ap_pstrcat(p,prefix,"_",signal,NULL);
  -printf("event name = %s\n", EventName);
  -event = OpenEvent(EVENT_ALL_ACCESS, FALSE, EventName);
  -printf("event handle = %d\n", event);
  -if (event == NULL) {
  - printf("Unable to open event %s.\n", EventName);
  -return;
  -}
  -SetEvent(event);
  -ResetEvent(event);
  -CloseHandle(event);
  -return;
  -}
   /*
* Initialise the signal names, in the global variables signal_name_prefix, 
* signal_restart_name and signal_shutdown_name.
  
  
  
  1.7   +89 -6 apache-2.0/src/os/win32/main_win32.c
  
  Index: main_win32.c
  ===
  RCS file: /home/cvs/apache-2.0/src/os/win32/main_win32.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.

cvs commit: apache-2.0/src/modules/mpm/winnt winnt.c

2000-02-14 Thread stoddard
stoddard00/02/14 06:28:17

  Modified:src/modules/mpm/winnt winnt.c
  Log:
  Enable Windows MPM to run in single process mode
  Submitted by: Allan Edwards
  Reviewed by:  Bill Stoddard
  
  Revision  ChangesPath
  1.38  +20 -0 apache-2.0/src/modules/mpm/winnt/winnt.c
  
  Index: winnt.c
  ===
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/winnt.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- winnt.c   2000/02/01 00:34:05 1.37
  +++ winnt.c   2000/02/14 14:28:16 1.38
  @@ -1237,7 +1237,16 @@
   
   /* Setup the listening sockets */
   if (one_process) {
  +ap_listen_rec *lr;
   setup_listeners(server_conf);
  +
  +/* Associate the socket with the IO Completion port */
  +for (lr = ap_listeners; lr; lr = lr->next) {
  +int nsd;
  +ap_get_os_sock(&nsd,lr->sd);
  +CreateIoCompletionPort((HANDLE) nsd, AcceptExCompPort, 0, 0);
  +}
  +  
   } else {
   setup_inherited_listeners(server_conf);
   }
  @@ -1745,7 +1754,18 @@
   AMCSocketInitialize();
   exit_event_name = ap_psprintf(pconf, "apC%d", my_pid);
   setup_signal_names(ap_psprintf(pconf,"ap%d", parent_pid));
  +
   if (one_process) {
  +/* Create the IO CompletionPort */
  +if (AcceptExCompPort == NULL) {
  +AcceptExCompPort = 
CreateIoCompletionPort(INVALID_HANDLE_VALUE,
  +  NULL, 0, 0); 
  +if (AcceptExCompPort == NULL) {
  +ap_log_error(APLOG_MARK,APLOG_ERR, GetLastError(), 
server_conf,
  + "Unable to create the 
AcceptExCompletionPort -- process will exit");
  +return -1;
  +}
  +}
   ap_create_lock(&start_mutex,APR_MUTEX, 
APR_CROSS_PROCESS,signal_name_prefix,pconf);
   exit_event = CreateEvent(NULL, TRUE, FALSE, exit_event_name);
   }
  
  
  


cvs commit: apache-2.0/src/lib/apr/network_io/os2 sendrecv.c

2000-02-14 Thread bjh
bjh 00/02/14 06:01:42

  Modified:src/lib/apr/network_io/os2 sendrecv.c
  Log:
  OS/2: ap_send/ap_recv/ap_sendv should set len to 0, not -1, when an error
  occurrs.
  
  Revision  ChangesPath
  1.7   +6 -6  apache-2.0/src/lib/apr/network_io/os2/sendrecv.c
  
  Index: sendrecv.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/sendrecv.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- sendrecv.c1999/11/03 14:03:25 1.6
  +++ sendrecv.c2000/02/14 14:01:42 1.7
  @@ -73,7 +73,7 @@
   rv = select(&fds, 0, 1, 0, sock->timeout >= 0 ? 
sock->timeout*1000 : -1);
   
   if (rv != 1) {
  -*len = -1;
  +*len = 0;
   err = sock_errno();
   
   if (rv == 0)
  @@ -91,7 +91,7 @@
   } while (err == SOCEINTR || err == SOCEWOULDBLOCK);
   
   if (err) {
  -*len = -1;
  +*len = 0;
   return os2errno(err);
   }
   
  @@ -112,7 +112,7 @@
   rv = select(&fds, 1, 0, 0, sock->timeout >= 0 ? 
sock->timeout*1000 : -1);
   
   if (rv != 1) {
  -*len = -1;
  +*len = 0;
   err = sock_errno();
   
   if (rv == 0)
  @@ -130,7 +130,7 @@
   } while (err == SOCEINTR || err == SOCEWOULDBLOCK);
   
   if (err) {
  -*len = -1;
  +*len = 0;
   return os2errno(err);
   }
   
  @@ -155,7 +155,7 @@
   rv = select(&fds, 0, 1, 0, sock->timeout >= 0 ? 
sock->timeout*1000 : -1);
   
   if (rv != 1) {
  -*len = -1;
  +*len = 0;
   err = sock_errno();
   
   if (rv == 0)
  @@ -173,7 +173,7 @@
   } while (err == SOCEINTR || err == SOCEWOULDBLOCK);
   
   if (err) {
  -*len = -1;
  +*len = 0;
   return os2errno(err);
   }
   
  
  
  


Apache Authentication problem

2000-02-14 Thread santhosh
This message was sent from Geocrawler.com by "santhosh" <[EMAIL PROTECTED]>
Be sure to reply to that address.

Dear all,

I am new to the list. I have a strange 
problem. .htpasswd file is getting blaked (crash) 
often. I have about 1000 entries.

I would appreciate any help in solving thus

Regards
santhosh

Geocrawler.com - The Knowledge Archive


cvs commit: apache-2.0/src/lib/apr/network_io/unix sendrecv.c

2000-02-14 Thread rbb
rbb 00/02/14 05:43:39

  Modified:src/lib/apr/network_io/unix sendrecv.c
  Log:
  Fix some bugs in ap_send and ap_recv.  We used to return APR_SUCCESS even
  when it didn't succeed.  The other problem this is solving, is that we
  never set the length to -1 anymore.  The length is the number of bytes
  written or read, as such -1 makes no sense.  If there is an error, 0 bytes
  were written, so len should be 0.
  Submitted by: Manoj Kasichainula and Ryan Bloom
  
  Revision  ChangesPath
  1.10  +10 -2 apache-2.0/src/lib/apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sendrecv.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- sendrecv.c2000/01/26 05:01:16 1.9
  +++ sendrecv.c2000/02/14 13:43:39 1.10
  @@ -108,17 +108,21 @@
   } while (srv == -1 && errno == EINTR);
   
   if (srv == 0) {
  -(*len) = -1;
  +(*len) = 0;
   return APR_TIMEUP;
   }
   else if (srv < 0) {
  -(*len) = -1;
  +(*len) = 0;
   return errno;
   }
   else {
   do {
   rv = write(sock->socketdes, buf, (*len));
   } while (rv == -1 && errno == EINTR);
  +if (rv == -1) {
  +(*len) = 0;
  +return errno;
  +}
   }
   }
   (*len) = rv;
  @@ -175,6 +179,10 @@
   do {
   rv = read(sock->socketdes, buf, (*len));
   } while (rv == -1 && errno == EINTR);
  +if (rv == -1) {
  +(*len) = 0;
  +return errno;
  +}
   }
   }
   else if (rv == -1 && errno == EAGAIN && sock->timeout == 0) {