You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/08/13 18:42:13 UTC
cvs commit: httpd-2.0/server/mpm/winnt mpm.h mpm_winnt.c
trawick 01/08/13 09:42:13
Modified: . libhttpd.dsp
include mpm_common.h
server mpm_common.c
server/mpm/winnt mpm.h mpm_winnt.c
Log:
(hopefully) get WinNT MPM to build using mpm_common.c code; a few notes:
. the selection of ap_sock_disable() is certainly ugly, but that may
need to be cleaned up in a different manner...
. the directive functions couldn't be AP_DECLARE() if they are to be
compatible with AP_INIT_TAKExxx(); this is an old restriction
Revision Changes Path
1.26 +4 -0 httpd-2.0/libhttpd.dsp
Index: libhttpd.dsp
===================================================================
RCS file: /home/cvs/httpd-2.0/libhttpd.dsp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- libhttpd.dsp 2001/06/27 19:39:15 1.25
+++ libhttpd.dsp 2001/08/13 16:42:13 1.26
@@ -409,6 +409,10 @@
# End Source File
# Begin Source File
+SOURCE=.\server\mpm_common.c
+# End Source File
+# Begin Source File
+
SOURCE=.\server\listen.c
# End Source File
# Begin Source File
1.26 +15 -15 httpd-2.0/include/mpm_common.h
Index: mpm_common.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/mpm_common.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- mpm_common.h 2001/08/13 15:44:00 1.25
+++ mpm_common.h 2001/08/13 16:42:13 1.26
@@ -225,27 +225,27 @@
* process handles before dying off
*/
#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
-extern int ap_max_requests_per_child;
-AP_DECLARE(const char *) ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
- const char *arg);
+extern int ap_max_requests_per_child;
+const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
+ const char *arg);
#endif
/**
* The filename used to store the process id.
*/
#ifdef AP_MPM_WANT_SET_PIDFILE
-extern const char *ap_pid_fname;
-AP_DECLARE(const char *) ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
- const char *arg);
+extern const char *ap_pid_fname;
+const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
+ const char *arg);
#endif
/**
* The name of lockfile used when Apache needs to lock the accept() call.
*/
#ifdef AP_MPM_WANT_SET_LOCKFILE
-extern const char *ap_lock_fname;
-AP_DECLARE(const char *) ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
- const char *arg);
+extern const char *ap_lock_fname;
+const char *ap_mpm_set_lockfile(cmd_parms *cmd, void *dummy,
+ const char *arg);
#endif
/**
@@ -253,16 +253,16 @@
*/
#ifdef AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
extern apr_lockmech_e_np accept_lock_mech;
-AP_DECLARE(const char *) ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
- const char *arg);
+const char *ap_mpm_set_accept_lock_mech(cmd_parms *cmd, void *dummy,
+ const char *arg);
#endif
/*
* Set the scorboard file.
*/
#ifdef AP_MPM_WANT_SET_SCOREBOARD
-AP_DECLARE(const char *) ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
- const char *arg);
+const char *ap_mpm_set_scoreboard(cmd_parms *cmd, void *dummy,
+ const char *arg);
#endif
/*
@@ -270,8 +270,8 @@
*/
#ifdef AP_MPM_WANT_SET_COREDUMPDIR
extern char ap_coredump_dir[MAX_STRING_LEN];
-AP_DECLARE(const char *) ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
- const char *arg);
+const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
+ const char *arg);
#endif
#ifdef __cplusplus
1.62 +7 -7 httpd-2.0/server/mpm_common.c
Index: mpm_common.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm_common.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- mpm_common.c 2001/08/13 15:44:00 1.61
+++ mpm_common.c 2001/08/13 16:42:13 1.62
@@ -271,7 +271,7 @@
}
#endif /* AP_MPM_WANT_PROCESS_CHILD_STATUS */
-#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF)
+#if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) && !defined(WIN32)
void ap_sock_disable_nagle(apr_socket_t *s)
{
/* The Nagle algorithm says that we should delay sending partial
@@ -485,8 +485,8 @@
#ifdef AP_MPM_WANT_SET_PIDFILE
const char *ap_pid_fname = NULL;
-AP_DECLARE(const char *)ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
- const char *arg)
+const char *ap_mpm_set_pidfile(cmd_parms *cmd, void *dummy,
+ const char *arg)
{
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err != NULL) {
@@ -532,8 +532,8 @@
#ifdef AP_MPM_WANT_SET_MAX_REQUESTS
int ap_max_requests_per_child = 0;
-AP_DECLARE(const char *) ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
- const char *arg)
+const char *ap_mpm_set_max_requests(cmd_parms *cmd, void *dummy,
+ const char *arg)
{
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
if (err != NULL) {
@@ -548,8 +548,8 @@
#ifdef AP_MPM_WANT_SET_COREDUMPDIR
char ap_coredump_dir[MAX_STRING_LEN];
-AP_DECLARE(const char *) ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
- const char *arg)
+const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
+ const char *arg)
{
apr_finfo_t finfo;
const char *fname;
1.8 +0 -3 httpd-2.0/server/mpm/winnt/mpm.h
Index: mpm.h
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- mpm.h 2001/08/13 04:57:35 1.7
+++ mpm.h 2001/08/13 16:42:13 1.8
@@ -69,11 +69,8 @@
#define MPM_NAME "WinNT"
#define AP_MPM_WANT_SET_PIDFILE
-#define AP_MPM_WANT_SET_SCOREBOARD
-#define AP_MPM_WANT_SET_LOCKFILE
#define AP_MPM_WANT_SET_MAX_REQUESTS
#define AP_MPM_WANT_SET_COREDUMPDIR
-#define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH
extern int ap_threads_per_child;
1.169 +0 -53 httpd-2.0/server/mpm/winnt/mpm_winnt.c
Index: mpm_winnt.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -r1.168 -r1.169
--- mpm_winnt.c 2001/08/02 22:12:45 1.168
+++ mpm_winnt.c 2001/08/13 16:42:13 1.169
@@ -121,8 +121,6 @@
static unsigned int g_blocked_threads = 0;
static int ap_max_requests_per_child=0;
-static char *ap_pid_fname = NULL;
-
static HANDLE shutdown_event; /* used to signal the parent to shutdown */
static HANDLE restart_event; /* used to signal the parent to restart */
static HANDLE exit_event; /* used by parent to signal the child to exit */
@@ -2040,19 +2038,6 @@
/*
* Command processors
*/
-static const char *set_pidfile(cmd_parms *cmd, void *dummy, char *arg)
-{
- const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
- if (err != NULL) {
- return err;
- }
-
- if (cmd->server->is_virtual) {
- return "PidFile directive not allowed in <VirtualHost>";
- }
- ap_pid_fname = arg;
- return NULL;
-}
static const char *set_threads_per_child (cmd_parms *cmd, void *dummy, char *arg)
{
@@ -2081,38 +2066,6 @@
return NULL;
}
-
-static const char *set_max_requests(cmd_parms *cmd, void *dummy, char *arg)
-{
- const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
- if (err != NULL) {
- return err;
- }
-
- ap_max_requests_per_child = atoi(arg);
-
- return NULL;
-}
-
-static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg)
-{
- apr_finfo_t finfo;
- const char *fname;
- const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
- if (err != NULL) {
- return err;
- }
-
- fname = ap_server_root_relative(cmd->pool, arg);
- if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS)
- || (finfo.filetype != APR_DIR)) {
- return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
- " does not exist or is not a directory", NULL);
- }
- apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
- return NULL;
-}
-
/* Stub functions until this MPM supports the connection status API */
AP_DECLARE(void) ap_update_connection_status(long conn_id, const char *key, \
@@ -2134,14 +2087,8 @@
static const command_rec winnt_cmds[] = {
LISTEN_COMMANDS
-{ "PidFile", set_pidfile, NULL, RSRC_CONF, TAKE1,
- "A file for logging the server process ID"},
{ "ThreadsPerChild", set_threads_per_child, NULL, RSRC_CONF, TAKE1,
"Number of threads each child creates" },
-{ "MaxRequestsPerChild", set_max_requests, NULL, RSRC_CONF, TAKE1,
- "Maximum number of requests a particular child serves before dying." },
-{ "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, TAKE1,
- "The location of the directory Apache changes to before dumping core" },
{ NULL }
};