enum pf_worker_status {
PF_WORKER_NONE = 0,
- PF_WORKER_IDLE,
+ PF_WORKER_ALIVE,
PF_WORKER_ACCEPTING,
- PF_WORKER_BUSY,
PF_WORKER_EXITING
};
* @param pf The mmaped area used to communicate with parent
* @param listen_fd_size The number of file descriptors to monitor
* @param listen_fds The array of file descriptors
-* @param lock_fd The locking file descriptor
* @param private_data Private data that needs to be passed to the main
* function from the calling parent.
*
int child_id,
int listen_fd_size,
int *listen_fds,
- int lock_fd,
void *private_data);
/**
int prefork_retire_children(struct prefork_pool *pfp,
int num_children, time_t age_limit);
/**
-* @brief Count the number of active children
+* @brief Count the number of children
*
* @param pfp The pool.
-* @param total Returns the number of children currently alive
+* @param active Number of children currently active if not NULL
*
-* @return The number of children actually serving clients
+* @return The total number of children.
*/
-int prefork_count_active_children(struct prefork_pool *pfp, int *total);
+int prefork_count_children(struct prefork_pool *pfp, int *active);
/**
-* @brief Inform all children that they are allowed to accept 'max' clients
-* now. Use this when all children are already busy and more clients
-* are trying to connect. It will allow each child to handle more than
-* one client at a time, up to 'max'.
+* @brief Count the number of actual connections currently allowed
+*
+* @param pfp The pool.
+*
+* @return The number of connections that can still be opened by clients
+* with the current pool of children.
+*/
+int prefork_count_allowed_connections(struct prefork_pool *pfp);
+
+/**
+* @brief Increase the amount of clients each child is allowed to handle
+* simultaneaously. It will allow each child to handle more than
+* one client at a time, up to 'max' (currently set to 100).
*
* @param pfp The pool.
-* @param max Max number of clients per child.
+* @param max Max number of allowed connections per child
*/
void prefork_increase_allowed_clients(struct prefork_pool *pfp, int max);
+/**
+* @brief Decrease the amount of clients each child is allowed to handle.
+* Min is 1.
+*
+* @param pfp The pool.
+*/
+void prefork_decrease_allowed_clients(struct prefork_pool *pfp);
+
/**
* @brief Reset the maximum allowd clients per child to 1.
* Does not reduce the number of clients actually beeing served by
* @param pf The child/parent shared structure
* @param listen_fd_size The number of listening file descriptors
* @param listen_fds The array of listening file descriptors
-* @param lock_fd The locking file descriptor
*
* @return The tevent request pointer or NULL on allocation errors.
*/
struct tevent_context *ev,
struct pf_worker_data *pf,
int listen_fd_size,
- int *listen_fds,
- int lock_fd);
+ int *listen_fds);
/**
* @brief Returns the file descriptor after the new client connection has
* been accepted.