[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-11-g
From: |
Giuseppe Scrivano |
Subject: |
[myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-11-geea2068 |
Date: |
Mon, 04 Jan 2010 00:54:58 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".
The branch, master has been updated
via eea2068f080bf97b69e1c0bbb0c47a2537b78d4e (commit)
via dad8b3e6f4c160e69bce97248adb898890f5a30e (commit)
from 021658a8c80d697d2c5fe5dc9a6d67a0e3435cf3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit eea2068f080bf97b69e1c0bbb0c47a2537b78d4e
Author: Giuseppe Scrivano <address@hidden>
Date: Mon Jan 4 01:47:14 2010 +0100
Assume argp is present
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index 625d9cc..94f1d63 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -29,9 +29,7 @@ extern "C"
# include <direct.h>
#endif
-#ifdef ARGP
# include <argp.h>
-#endif
#ifndef WIN32
# include <string.h>
@@ -122,10 +120,6 @@ void registerSignals ()
#endif
}
-
-
-#ifdef ARGP
-
struct argp_input
{
/* Print the version for MyServer? */
@@ -159,12 +153,19 @@ enum
static struct argp_option options[] =
{
/* LONG NAME - SHORT NAME - PARAMETER NAME - FLAGS - DESCRIPTION. */
- {"version", 'v', "VERSION", OPTION_ARG_OPTIONAL , _("Print the version for
the application")},
- {"run", 'r', "RUN", OPTION_ARG_OPTIONAL, _("Specify how run the server (by
default console mode)")},
- {"log", 'l', "location", 0, _("Specify the location (using the format
protocol://resource) to use as the main log.")},
- {"pidfile", 'p', "file", 0, _("Specify the file where write the PID")},
- {"fork_server", 'f', NULL, 0, _("Specify if use a fork server")},
- {"cfgdir", CONFIG_OPT, "dir", 0, _("Specify an alternative directory where
look for configuration files")},
+ {"version", 'v', "VERSION", OPTION_ARG_OPTIONAL ,
+ _("Print the version for the application")},
+ {"run", 'r', "RUN", OPTION_ARG_OPTIONAL,
+ _("Specify how run the server (by default console mode)")},
+ {"log", 'l', "location", 0,
+ _("Specify the location (using the format protocol://resource) to use "
+ "as the main log.")},
+ {"pidfile", 'p', "file", 0,
+ _("Specify the file where write the PID")},
+ {"fork_server", 'f', NULL, 0,
+ _("Specify if use a fork server")},
+ {"cfgdir", CONFIG_OPT, "dir", 0,
+ _("Specify an alternative directory where look for configuration files")},
{0}
};
@@ -217,9 +218,6 @@ static error_t parseOpt (int key, char *arg, struct
argp_state *state)
static struct argp myserverArgp = {options, parseOpt, argsDoc, doc};
-#endif
-
-
/*!
* Load the external path.
* Return nonzero on errors.
@@ -347,9 +345,7 @@ int main (int argn, char **argv)
{
program_name = argv[0];
int runas = MYSERVER_RUNAS_CONSOLE;
-#ifdef ARGP
struct argp_input input;
-#endif
#ifndef WIN32
pid_t pid;
@@ -408,7 +404,6 @@ int main (int argn, char **argv)
/* We can free path memory now. */
delete [] path;
-#ifdef ARGP
/* Reset the struct. */
input.version = 0;
input.confFilesLocation = NULL;
@@ -440,55 +435,11 @@ int main (int argn, char **argv)
<< "http://www.gnu.org/software/myserver" << endl;
return 0;
}
-#else
- if (argn > 1)
- {
- if (!strcmpi (argv[1], "VERSION"))
- {
- cout << MYSERVER_VERSION << endl;
- return 0;
- }
- if (!strcmpi (argv[1], "CONSOLE"))
- {
- runas = MYSERVER_RUNAS_CONSOLE;
- }
- if (!strcmpi (argv[1], "REGISTER"))
- {
- registerService ();
-# ifndef ARGP
- runAsService ();
-# endif
- runas = MYSERVER_RUNAS_SERVICE;
- return 0;
- }
- if (!strcmpi (argv[1], "RUNSERVICE"))
- {
- runAsService ();
- return 0;
- }
- if (!strcmpi (argv[1], "UNREGISTER"))
- {
- removeService ();
- runas = MYSERVER_RUNAS_SERVICE;
- return 0;
- }
- if (!strcmpi (argv[1], "SERVICE"))
- {
- /*
- * Set the log file to use when in service mode.
- */
- runas = MYSERVER_RUNAS_SERVICE;
- }
- }
-#endif
-
-#ifdef ARGP
if (input.useForkServer)
{
FilesUtility::resetTmpPath ();
Process::getForkServer ()->startForkServer ();
}
-#endif
/*
* Start here the MyServer execution.
@@ -531,14 +482,10 @@ int main (int argn, char **argv)
if (pid)
{
-# ifdef ARGP
if (input.pidFileName)
writePidfile (input.pidFileName);
else
writePidfile ();
-# else
- writePidfile ();
-# endif
return 0;
}
/*
@@ -557,10 +504,8 @@ int main (int argn, char **argv)
return 1;
};
-#ifdef ARGP
if (input.useForkServer)
Process::getForkServer ()->killServer ();
-#endif
return 0;
}
@@ -588,7 +533,6 @@ int writePidfile (const char* filename)
}
pidfile = open (filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
-
if (pidfile == -1)
return -1;
@@ -606,13 +550,14 @@ int writePidfile (const char* filename)
/*!
* Start MyServer in console mode.
*/
-void consoleService (string &mainConf, string &mimeConf, string &vhostConf,
string &externPath,
- MainConfiguration* (*genMainConf) (Server *server, const
char *arg))
+void consoleService (string &mainConf, string &mimeConf, string &vhostConf,
+ string &externPath, MainConfiguration* (*genMainConf)
+ (Server *server, const char *arg))
{
- Server::getInstance ()->start (mainConf, mimeConf, vhostConf, externPath,
genMainConf);
+ Server::getInstance ()->start (mainConf, mimeConf, vhostConf, externPath,
+ genMainConf);
}
-
/*!
* These functions are available only on the windows platform.
*/
@@ -660,7 +605,8 @@ void __stdcall myServerMainNT (u_long, LPTSTR*)
loadConfFilesLocation (mainConf, mimeConf, vhostConf, externPath, NULL);
- Server::getInstance ()->start (mainConf, mimeConf, vhostConf,
externPath, &genMainConf);
+ Server::getInstance ()->start (mainConf, mimeConf, vhostConf, externPath,
+ &genMainConf);
MyServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
SetServiceStatus (MyServiceStatusHandle, &MyServiceStatus);
commit dad8b3e6f4c160e69bce97248adb898890f5a30e
Author: Giuseppe Scrivano <address@hidden>
Date: Mon Jan 4 01:15:36 2010 +0100
Use <stdint.h> types, not define them again
diff --git a/myserver/stdafx.h b/myserver/stdafx.h
index 512a1e7..b703f20 100644
--- a/myserver/stdafx.h
+++ b/myserver/stdafx.h
@@ -50,7 +50,7 @@ extern "C"
#include <math.h>
#include "time.h"
#include <ctype.h>
-
+#include <stdint.h>
#ifndef WIN32
# include <sys/types.h>
@@ -59,16 +59,6 @@ extern "C"
#endif
}
-#ifndef HOST_NAME_MAX
-# define HOST_NAME_MAX 255
-#endif
-
-typedef unsigned long DWORD;
-typedef unsigned int u_int;
-typedef unsigned long u_long;
-typedef unsigned short u_short;
-typedef unsigned char u_char;
-
typedef void* HANDLE;
#ifndef SOCKET_ERROR
-----------------------------------------------------------------------
Summary of changes:
myserver/src/myserver.cpp | 94 +++++++++-----------------------------------
myserver/stdafx.h | 12 +-----
2 files changed, 21 insertions(+), 85 deletions(-)
hooks/post-receive
--
GNU MyServer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-11-geea2068,
Giuseppe Scrivano <=