cvs commit: apachen/src/ap ap.dsp ap.mak
pcs 98/01/04 05:03:51 Added: src/ap ap.dsp ap.mak Log: Makefile and project to build libap on Win32 Revision ChangesPath 1.1 apachen/src/ap/ap.dsp Index: ap.dsp === # Microsoft Developer Studio Project File - Name=ap - Package Owner=4 # Microsoft Developer Studio Generated Build File, Format Version 5.00 # ** DO NOT EDIT ** # TARGTYPE Win32 (x86) Static Library 0x0104 CFG=ap - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f ap.mak. !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f ap.mak CFG=ap - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE ap - Win32 Release (based on Win32 (x86) Static Library) !MESSAGE ap - Win32 Debug (based on Win32 (x86) Static Library) !MESSAGE # Begin Project # PROP Scc_ProjName # PROP Scc_LocalPath CPP=cl.exe !IF $(CFG) == ap - Win32 Release # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir Release # PROP BASE Intermediate_Dir Release # PROP BASE Target_Dir # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir Release # PROP Intermediate_Dir Release # PROP Target_Dir # ADD BASE CPP /nologo /W3 /GX /O2 /D WIN32 /D NDEBUG /D _WINDOWS /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /I ../main /D WIN32 /D NDEBUG /D _WINDOWS /YX /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF $(CFG) == ap - Win32 Debug # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir Debug # PROP BASE Intermediate_Dir Debug # PROP BASE Target_Dir # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir Debug # PROP Intermediate_Dir Debug # PROP Target_Dir # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D WIN32 /D _DEBUG /D _WINDOWS /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I ../main /D WIN32 /D _DEBUG /D _WINDOWS /YX /FD /c BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name ap - Win32 Release # Name ap - Win32 Debug # Begin Group Source Files # PROP Default_Filter # Begin Source File SOURCE=.\ap_cpystrn.c # End Source File # Begin Source File SOURCE=.\ap_signal.c # End Source File # Begin Source File SOURCE=.\ap_slack.c # End Source File # Begin Source File SOURCE=.\ap_snprintf.c # End Source File # Begin Source File SOURCE=.\ap_strings.c # End Source File # End Group # Begin Group Header Files # PROP Default_Filter # End Group # End Target # End Project 1.1 apachen/src/ap/ap.mak Index: ap.mak === # Microsoft Developer Studio Generated NMAKE File, Based on ap.dsp !IF $(CFG) == CFG=ap - Win32 Debug !MESSAGE No configuration specified. Defaulting to ap - Win32 Debug. !ENDIF !IF $(CFG) != ap - Win32 Release $(CFG) != ap - Win32 Debug !MESSAGE Invalid configuration $(CFG) specified. !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f ap.mak CFG=ap - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE ap - Win32 Release (based on Win32 (x86) Static Library) !MESSAGE ap - Win32 Debug (based on Win32 (x86) Static Library) !MESSAGE !ERROR An invalid configuration is specified. !ENDIF !IF $(OS) == Windows_NT NULL= !ELSE NULL=nul !ENDIF CPP=cl.exe !IF $(CFG) == ap - Win32 Release OUTDIR=.\Release INTDIR=.\Release # Begin Custom Macros OutDir=.\Release # End Custom Macros !IF $(RECURSE) == 0 ALL : $(OUTDIR)\ap.lib !ELSE ALL : $(OUTDIR)\ap.lib !ENDIF CLEAN : [EMAIL PROTECTED] $(INTDIR)\ap_cpystrn.obj [EMAIL PROTECTED] $(INTDIR)\ap_snprintf.obj [EMAIL PROTECTED] $(INTDIR)\ap_strings.obj [EMAIL PROTECTED] $(INTDIR)\vc50.idb [EMAIL PROTECTED] $(OUTDIR)\ap.lib $(OUTDIR) : if not exist $(OUTDIR)/$(NULL) mkdir $(OUTDIR) CPP_PROJ=/nologo /ML /W3 /GX /O2 /I ../main /D WIN32 /D NDEBUG /D\ _WINDOWS /Fp$(INTDIR)\ap.pch /YX /Fo$(INTDIR)\\ /Fd$(INTDIR)\\ /FD /c CPP_OBJS=.\Release/ CPP_SBRS=. BSC32=bscmake.exe BSC32_FLAGS=/nologo /o$(OUTDIR)\ap.bsc BSC32_SBRS= \ LIB32=link.exe -lib LIB32_FLAGS=/nologo
cvs commit: apachen/src ApacheCore.dsp ApacheCore.mak
pcs 98/01/04 05:06:11 Modified:src ApacheCore.dsp ApacheCore.mak Log: Build apache using the ap library on Win32. Revision ChangesPath 1.16 +2 -6 apachen/src/ApacheCore.dsp Index: ApacheCore.dsp === RCS file: /export/home/cvs/apachen/src/ApacheCore.dsp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- ApacheCore.dsp1997/12/24 12:37:07 1.15 +++ ApacheCore.dsp1998/01/04 13:06:09 1.16 @@ -54,7 +54,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 os\win32\ApacheOSR\ApacheOS.lib regex\release\regex.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 os\win32\ApacheOSR\ApacheOS.lib regex\release\regex.lib ap\Release\ap.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll /machine:I386 !ELSEIF $(CFG) == ApacheCore - Win32 Debug @@ -80,7 +80,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 os\win32\ApacheOSD\ApacheOS.lib regex\debug\regex.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 os\win32\ApacheOSD\ApacheOS.lib regex\debug\regex.lib ap\Debug\ap.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll /debug /machine:I386 !ENDIF @@ -94,10 +94,6 @@ # Begin Source File SOURCE=.\main\alloc.c -# End Source File -# Begin Source File - -SOURCE=.\ap\ap_snprintf.c # End Source File # Begin Source File 1.26 +338 -920 apachen/src/ApacheCore.mak Index: ApacheCore.mak === RCS file: /export/home/cvs/apachen/src/ApacheCore.mak,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ApacheCore.mak1997/12/30 16:42:31 1.25 +++ ApacheCore.mak1998/01/04 13:06:09 1.26 @@ -52,9 +52,6 @@ CLEAN : [EMAIL PROTECTED] $(INTDIR)\alloc.obj - [EMAIL PROTECTED] $(INTDIR)\ap_cpystrn.obj - [EMAIL PROTECTED] $(INTDIR)\ap_snprintf.obj - [EMAIL PROTECTED] $(INTDIR)\ap_strings.obj [EMAIL PROTECTED] $(INTDIR)\buff.obj [EMAIL PROTECTED] $(INTDIR)\buildmark.obj [EMAIL PROTECTED] $(INTDIR)\explain.obj @@ -98,16 +95,14 @@ [EMAIL PROTECTED] $(INTDIR)\util_script.obj [EMAIL PROTECTED] $(INTDIR)\util_win32.obj [EMAIL PROTECTED] $(INTDIR)\vc50.idb - [EMAIL PROTECTED] $(INTDIR)\vc50.pdb [EMAIL PROTECTED] $(OUTDIR)\ApacheCore.dll [EMAIL PROTECTED] $(OUTDIR)\ApacheCore.exp [EMAIL PROTECTED] $(OUTDIR)\ApacheCore.lib - [EMAIL PROTECTED] $(OUTDIR)\ApacheCore.pdb $(OUTDIR) : if not exist $(OUTDIR)/$(NULL) mkdir $(OUTDIR) -CPP_PROJ=/nologo /MD /W3 /GX /Zi /O2 /I .\regex /I .\main /D WIN32 /D\ +CPP_PROJ=/nologo /MD /W3 /GX /O2 /I .\regex /I .\main /D WIN32 /D\ NDEBUG /D _WINDOWS /Fp$(INTDIR)\ApacheCore.pch /YX /Fo$(INTDIR)\\\ /Fd$(INTDIR)\\ /FD /c CPP_OBJS=.\CoreR/ @@ -119,17 +114,15 @@ LINK32=link.exe LINK32_FLAGS=os\win32\ApacheOSR\ApacheOS.lib regex\release\regex.lib\ - kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib\ - shell32.lib wsock32.lib /nologo /subsystem:windows /dll /incremental:no\ - /pdb:$(OUTDIR)\ApacheCore.pdb /debug /machine:I386 /def:.\ApacheCore.def\ - /out:$(OUTDIR)\ApacheCore.dll /implib:$(OUTDIR)\ApacheCore.lib + ap\Release\ap.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll\ + /incremental:no /pdb:$(OUTDIR)\ApacheCore.pdb /machine:I386\ + /def:.\ApacheCore.def /out:$(OUTDIR)\ApacheCore.dll\ + /implib:$(OUTDIR)\ApacheCore.lib DEF_FILE= \ .\ApacheCore.def LINK32_OBJS= \ $(INTDIR)\alloc.obj \ - $(INTDIR)\ap_cpystrn.obj \ - $(INTDIR)\ap_snprintf.obj \ - $(INTDIR)\ap_strings.obj \ $(INTDIR)\buff.obj \ $(INTDIR)\buildmark.obj \ $(INTDIR)\explain.obj \ @@ -199,12 +192,6 @@ CLEAN : [EMAIL PROTECTED] $(INTDIR)\alloc.obj [EMAIL PROTECTED] $(INTDIR)\alloc.sbr -
cvs commit: apachen/src/modules/proxy ApacheModuleProxy.dsp ApacheModuleProxy.mak
pcs 98/01/04 05:20:42 Modified:src/modules/proxy ApacheModuleProxy.dsp ApacheModuleProxy.mak Log: Remove dependencies on ODBC and OLE libraries (Win32) Revision ChangesPath 1.5 +2 -2 apachen/src/modules/proxy/ApacheModuleProxy.dsp Index: ApacheModuleProxy.dsp === RCS file: /export/home/cvs/apachen/src/modules/proxy/ApacheModuleProxy.dsp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ApacheModuleProxy.dsp 1997/09/13 23:10:52 1.4 +++ ApacheModuleProxy.dsp 1998/01/04 13:20:41 1.5 @@ -55,7 +55,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 -# ADD LINK32 ..\..\CoreR\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 ..\..\CoreR\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll /machine:I386 !ELSEIF $(CFG) == ApacheModuleProxy - Win32 Debug @@ -81,7 +81,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 -# ADD LINK32 ..\..\CoreD\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 ..\..\CoreD\ApacheCore.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo /subsystem:windows /dll /debug /machine:I386 !ENDIF 1.6 +56 -9 apachen/src/modules/proxy/ApacheModuleProxy.mak Index: ApacheModuleProxy.mak === RCS file: /export/home/cvs/apachen/src/modules/proxy/ApacheModuleProxy.mak,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ApacheModuleProxy.mak 1997/09/05 19:39:21 1.5 +++ ApacheModuleProxy.mak 1998/01/04 13:20:41 1.6 @@ -79,10 +79,9 @@ LINK32=link.exe LINK32_FLAGS=..\..\CoreR\ApacheCore.lib kernel32.lib user32.lib gdi32.lib\ - winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ - uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /dll\ - /incremental:no /pdb:$(OUTDIR)\ApacheModuleProxy.pdb /machine:I386\ - /out:$(OUTDIR)\ApacheModuleProxy.dll\ + winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo\ + /subsystem:windows /dll /incremental:no /pdb:$(OUTDIR)\ApacheModuleProxy.pdb\ + /machine:I386 /out:$(OUTDIR)\ApacheModuleProxy.dll\ /implib:$(OUTDIR)\ApacheModuleProxy.lib LINK32_OBJS= \ $(INTDIR)\mod_proxy.obj \ @@ -133,7 +132,7 @@ $(OUTDIR) : if not exist $(OUTDIR)/$(NULL) mkdir $(OUTDIR) -CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I ..\..\main /I ..\..\regex /D\ +CPP_PROJ=/nologo /MDd /W4 /Gm /GX /Zi /Od /I ..\..\main /I ..\..\regex /D\ WIN32 /D _DEBUG /D _WINDOWS /Fp$(INTDIR)\ApacheModuleProxy.pch /YX\ /Fo$(INTDIR)\\ /Fd$(INTDIR)\\ /FD /c CPP_OBJS=.\Debug/ @@ -145,10 +144,9 @@ LINK32=link.exe LINK32_FLAGS=..\..\CoreD\ApacheCore.lib kernel32.lib user32.lib gdi32.lib\ - winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib\ - uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:windows /dll\ - /incremental:yes /pdb:$(OUTDIR)\ApacheModuleProxy.pdb /debug /machine:I386\ - /out:$(OUTDIR)\ApacheModuleProxy.dll\ + winspool.lib comdlg32.lib advapi32.lib shell32.lib wsock32.lib /nologo\ + /subsystem:windows /dll /incremental:yes /pdb:$(OUTDIR)\ApacheModuleProxy.pdb\ + /debug /machine:I386 /out:$(OUTDIR)\ApacheModuleProxy.dll\ /implib:$(OUTDIR)\ApacheModuleProxy.lib LINK32_OBJS= \ $(INTDIR)\mod_proxy.obj \ @@ -211,6 +209,7 @@ ..\..\main\http_log.h\ ..\..\main\http_protocol.h\ ..\..\main\httpd.h\ + ..\..\os\win32\os.h\ ..\..\os\win32\readdir.h\ ..\..\regex\regex.h\ .\mod_proxy.h\ @@ -230,9 +229,16 @@ ..\..\main\http_log.h\ ..\..\main\http_protocol.h\ ..\..\main\httpd.h\ + ..\..\os\win32\os.h\ ..\..\os\win32\readdir.h\ ..\..\regex\regex.h\ .\mod_proxy.h\ + {$(INCLUDE)}sys\stat.h\ +
cvs commit: apachen/src/main http_log.h
pcs 98/01/04 06:21:56 Modified:src/main http_log.h Log: When reporting Win32 errors, do not show value of errno Revision ChangesPath 1.21 +1 -1 apachen/src/main/http_log.h Index: http_log.h === RCS file: /export/home/cvs/apachen/src/main/http_log.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- http_log.h1997/12/07 15:48:00 1.20 +++ http_log.h1998/01/04 14:21:55 1.21 @@ -84,7 +84,7 @@ #ifdef WIN32 /* Set to indicate that error msg should come from Win32's GetLastError(), * not errno. */ -#define APLOG_WIN32ERROR ((APLOG_LEVELMASK+1) * 2) +#define APLOG_WIN32ERROR ((APLOG_LEVELMASK+1) * 2|APLOG_NOERRNO) #endif #ifndef DEFAULT_LOGLEVEL
cvs commit: apachen/src Makefile.nt
ben 98/01/04 06:43:47 Modified:src Makefile.nt Log: Add ap library to clean. Revision ChangesPath 1.21 +8 -0 apachen/src/Makefile.nt Index: Makefile.nt === RCS file: /export/home/cvs/apachen/src/Makefile.nt,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Makefile.nt 1998/01/04 14:42:20 1.20 +++ Makefile.nt 1998/01/04 14:43:46 1.21 @@ -138,6 +138,10 @@ set CFG=regex - Win32 Release nmake /nologo -f regex.mak clean cd .. + cd ap + set CFG=ap - Win32 Release + nmake /nologo -f ap.mak clean + cd .. set CFG=ApacheCore - Win32 Release nmake /nologo -f ApacheCore.mak clean set CFG=Apache - Win32 Release @@ -173,6 +177,10 @@ cd regex set CFG=regex - Win32 Debug nmake /nologo -f regex.mak clean + cd .. + cd ap + set CFG=ap - Win32 Debug + nmake /nologo -f ap.mak clean cd .. set CFG=ApacheCore - Win32 Debug nmake /nologo -f ApacheCore.mak clean
cvs commit: apachen/src/os/win32 service.c service.h
pcs 98/01/04 07:26:20 Modified:src/os/win32 service.c service.h Log: When a shutdown is requested, call start_shutdown() to set it up, rather than setting the global service_stop variable. start_shutdown() will set the appropriate variables and wakeup the parent process main thread Revision ChangesPath 1.6 +3 -7 apachen/src/os/win32/service.c Index: service.c === RCS file: /export/home/cvs/apachen/src/os/win32/service.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- service.c 1998/01/04 14:33:07 1.5 +++ service.c 1998/01/04 15:26:19 1.6 @@ -16,8 +16,6 @@ { int (*main_fn)(int, char **); event *stop_event; -int *stop_flag; -int *pause_flag; int connected; SERVICE_STATUS_HANDLE hServiceStatus; char *name; @@ -34,7 +32,7 @@ int service_main(int (*main_fn)(int, char **), int argc, char **argv, - int *pause, int *stop, char *service_name, + char *service_name, int install_flag, int run_as_service) { SERVICE_TABLE_ENTRY dispatchTable[] = @@ -58,9 +56,7 @@ else { globdat.main_fn = main_fn; -globdat.stop_event = create_event(0, 0, NULL); -globdat.stop_flag = stop; -globdat.pause_flag = pause; +globdat.stop_event = create_event(0, 0, apache-signal); if(run_as_service) { @@ -149,7 +145,7 @@ // case SERVICE_CONTROL_STOP: state = SERVICE_STOP_PENDING; -*(globdat.stop_flag) = 1; + start_shutdown(); break; // Update the service status. 1.2 +1 -1 apachen/src/os/win32/service.h Index: service.h === RCS file: /export/home/cvs/apachen/src/os/win32/service.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- service.h 1997/06/15 19:22:53 1.1 +++ service.h 1998/01/04 15:26:20 1.2 @@ -4,7 +4,7 @@ #ifdef WIN32 int service_main(int (*main_fn)(int, char **), int argc, char **argv, - int *pause, int *stop, char *service_name, + char *service_name, int install_flag, int run_as_service); void service_set_status(int status); void service_cd();
cvs commit: apachen/src/main http_main.c http_main.h
pcs 98/01/04 07:36:46 Modified:src/main http_main.c http_main.h Log: Major Win32 multithreading overheal. The changes are: - Replaced assert()'s with aplog_errors() in various places, so that we don't loose error checking in the release build. Also asserts() do an ungraceful exit - try to be kinder to the user. - Added some debug macros to send messages to the screen or error log (these are just for convenience - if you don't like them they can be removed) (APD1() thru APD5()). - Add model-independent functions to initiate a restart or shutdown. Currently this is initiated in functions which know they are being called as a signal handler. This is now abstracted to a separate functions, which can be called from a signal handler, or on Win32 from the service controller callback. (start_shutdown(), start_restart()) - Added lots of comments to the MT part of the code probably containing lots of tyops, er, typos. - In child_sub_main() (the worker thread code) used ptrans for the temporary pool, instead of pchild - now consistent with Unix child_main() [Incidently I'm not sure why ptrans is a global, since it (should) only be used within child_main()?] - made the parent thread (worker_main()) exit without going into the main parent loop if it is being signalled to die. Create the child pool (pchild) here (since this pool has a lifetime of a process, not a child (thread)). Cleanup this pool on exit, and run child_exit_modules(). - worker_main() now will not exit until all the connections in its listen() queue are dealt with (previous it would count_down a few requests, then die, which would loose the connections in this process'es listen() queue). This now makes graceful restarts not loose connections. Once worker_main() has been told to exit it frees the mutex to allow another worker_main() to get into a listen() [however it seems Win32 directs incoming requests to the first process annoyingly]. To give the old worker_main() a chance to exit, only sleep for 1 second in the select. Also catch problems if the select() returns immediately with an error (previously this would cause a busy loop forever). - In the parent process (master_main()) abstract the creation/removal of processes (create_process(), cleanup_process()). Only bother to create one child process at once (more are unnecessary). Use an event to simulate a signal (with variables used to determine what action should be taken). Block forever waiting for a child to die or for the signal event (previously it would loop every 2 seconds). Handle shutdowns and restarts (both graceful). Allow multiple graceful restarts. Log error conditions like when child processes have to be forcibly terminated. - Update os/win32/service.c so that a net stop apache sends a graceful shutdown signal (using start_shutdown()). By changing this to call start_restart() you can also test graceful restarts. - Some unused code to do ungraceful shutdown/restart. Currently mutually exclusive with graceful restarts. Not compiled in by default. See the comments about UNGRACEFUL_RESTARTS in the patch. On the downside, this patch - Makes the MT code more Win32 specific (this is necessary since it is useful to do WaitForMultipleObject() type things, for instance, and we don't have an abstraction for that). Also the Win32 stuff should use completion ports, and again we don't have an abstraction. However this does give us a good idea of stuff that does need abstracting. - I haven't checked for resource leaks, proper pool maintenence, or proper sequences of module init/child init/child exit API calls. - Makes http_main.c even bigger. I was going to split it out in core, multi-process and MT parts at the outset but that would have made comparing the patch pretty difficult. However I think it is a good idea to move the code in the #ifdef MULTITHREAD/#endif part to a separate http_main_mt.c (or maybe a http_main_win32 since it is quite specific at the moment). Revision ChangesPath 1.262 +529 -106 apachen/src/main/http_main.c Index: http_main.c === RCS file: /export/home/cvs/apachen/src/main/http_main.c,v retrieving revision 1.261 retrieving revision 1.262 diff -u -r1.261 -r1.262 --- http_main.c 1997/12/30 15:10:47 1.261 +++ http_main.c 1998/01/04 15:36:44 1.262 @@ -108,6 +108,36 @@ #include bstring.h /* for IRIX, FD_SET calls bzero() */ #endif +#ifdef MULTITHREAD +/* special debug stuff -- PCS */ + + /* APD1() to APD5() are macros to help us debug. Then can either + * log to the screen or the error_log
cvs commit: apachen/src/main http_log.c http_log.h
pcs 98/01/04 08:35:29 Modified:src/main http_log.c http_log.h Log: Fix removing errno from APLOG_WIN32ERROR error messages. Revision ChangesPath 1.46 +5 -1 apachen/src/main/http_log.c Index: http_log.c === RCS file: /export/home/cvs/apachen/src/main/http_log.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- http_log.c1998/01/03 00:18:38 1.45 +++ http_log.c1998/01/04 16:35:28 1.46 @@ -315,7 +315,11 @@ len += ap_snprintf(errstr + len, sizeof(errstr) - len, %s(%d): , file, line); } -if (!(level APLOG_NOERRNO)) { +if (!(level APLOG_NOERRNO) +#ifdef WIN32 + !(level APLOG_WIN32ERROR) +#endif + ) { len += ap_snprintf(errstr + len, sizeof(errstr) - len, (%d)%s: , save_errno, strerror(save_errno)); } 1.22 +1 -1 apachen/src/main/http_log.h Index: http_log.h === RCS file: /export/home/cvs/apachen/src/main/http_log.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- http_log.h1998/01/04 14:21:55 1.21 +++ http_log.h1998/01/04 16:35:28 1.22 @@ -84,7 +84,7 @@ #ifdef WIN32 /* Set to indicate that error msg should come from Win32's GetLastError(), * not errno. */ -#define APLOG_WIN32ERROR ((APLOG_LEVELMASK+1) * 2|APLOG_NOERRNO) +#define APLOG_WIN32ERROR ((APLOG_LEVELMASK+1) * 2) #endif #ifndef DEFAULT_LOGLEVEL
cvs commit: apachen/src/main http_log.c
pcs 98/01/04 09:03:19 Modified:src/main http_log.c Log: Correct into a Revision ChangesPath 1.47 +1 -1 apachen/src/main/http_log.c Index: http_log.c === RCS file: /export/home/cvs/apachen/src/main/http_log.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- http_log.c1998/01/04 16:35:28 1.46 +++ http_log.c1998/01/04 17:03:18 1.47 @@ -317,7 +317,7 @@ } if (!(level APLOG_NOERRNO) #ifdef WIN32 - !(level APLOG_WIN32ERROR) + !(level APLOG_WIN32ERROR) #endif ) { len += ap_snprintf(errstr + len, sizeof(errstr) - len,