[Openvas-commits] r7406 - in trunk/openvas-manager: . src
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Apr 23 11:28:17 CEST 2010
Author: felix
Date: 2010-04-23 11:28:12 +0200 (Fri, 23 Apr 2010)
New Revision: 7406
Modified:
trunk/openvas-manager/ChangeLog
trunk/openvas-manager/src/openvasmd.c
Log:
* src/openvasmd.c: Added stub for documentation subsection about
forking behaviour of openvasmd.
(accept_and_maybe_fork): Made static.
(main): Added comments, collapsed unconditioned statement.
Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog 2010-04-23 09:18:51 UTC (rev 7405)
+++ trunk/openvas-manager/ChangeLog 2010-04-23 09:28:12 UTC (rev 7406)
@@ -1,5 +1,12 @@
2010-04-23 Felix Wolfsteller <felix.wolfsteller at greenbone.net>
+ * src/openvasmd.c: Added stub for documentation subsection about
+ forking behaviour of openvasmd.
+ (accept_and_maybe_fork): Made static.
+ (main): Added comments, collapsed unconditioned statement.
+
+2010-04-23 Felix Wolfsteller <felix.wolfsteller at greenbone.net>
+
* src/openvasmd.c: Removed setting of experimental FORK flag.
(accept_and_maybe_fork): Removed pathes that were started to have a
non-forking manager.
Modified: trunk/openvas-manager/src/openvasmd.c
===================================================================
--- trunk/openvas-manager/src/openvasmd.c 2010-04-23 09:18:51 UTC (rev 7405)
+++ trunk/openvas-manager/src/openvasmd.c 2010-04-23 09:28:12 UTC (rev 7406)
@@ -68,6 +68,11 @@
*
* The Manager tests share some code in src/tests/\ref common.c.
*
+ * \subsection Forking
+ *
+ * The main daemon manager process will fork for every incoming connection and
+ * for every scheduled task.
+ *
* \section copying License Information
* \verbinclude COPYING
*/
@@ -380,7 +385,7 @@
* Accept the client connection and fork a child process to serve the client.
* The child calls \ref serve_client to do the rest of the work.
*/
-void
+static void
accept_and_maybe_fork ()
{
/* Accept the client connection. */
@@ -1236,13 +1241,13 @@
if (manage_schedule (fork_connection_for_schedular))
exit (EXIT_FAILURE);
last_schedule_time = time (NULL);
- timeout.tv_sec = SCHEDULE_PERIOD;
}
- else
- timeout.tv_sec = SCHEDULE_PERIOD;
+
+ timeout.tv_sec = SCHEDULE_PERIOD;
timeout.tv_usec = 0;
ret = select (nfds, &readfds, NULL, &exceptfds, &timeout);
+ // Error while selecting socket.
if (ret == -1)
{
if (errno == EINTR)
@@ -1252,6 +1257,7 @@
strerror (errno));
exit (EXIT_FAILURE);
}
+ // Incoming connection.
if (ret > 0)
{
if (FD_ISSET (manager_socket, &exceptfds))
More information about the Openvas-commits
mailing list