Apache2
simple_types.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "apr.h"
18 #include "apr_pools.h"
19 #include "apr_poll.h"
20 #include "apr_hash.h"
21 #include "apr_ring.h"
22 #include "apr_thread_pool.h"
23 #include "apr_buckets.h"
24 #include "httpd.h"
25 
26 #ifndef APACHE_MPM_SIMPLE_TYPES_H
27 #define APACHE_MPM_SIMPLE_TYPES_H
28 
29 typedef struct simple_core_t simple_core_t;
30 
31 typedef struct
32 {
37 
38 #define SIMPLE_MAX_PROC (500000)
39 #define SIMPLE_DEF_PROC (5)
40 #define SIMPLE_MIN_PROC (1)
41 #define SIMPLE_MAX_THREADS (500000)
42 #define SIMPLE_DEF_THREADS (5)
43 #define SIMPLE_MIN_THREADS (1)
44 
45 typedef void (*simple_timer_cb) (simple_core_t * sc, void *baton);
46 typedef void (*simple_io_sock_cb) (simple_core_t * sc, apr_socket_t * sock,
47  int flags, void *baton);
48 typedef void (*simple_io_file_cb) (simple_core_t * sc, apr_socket_t * sock,
49  int flags, void *baton);
50 
51 typedef struct simple_sb_t simple_sb_t;
52 
53 typedef enum
54 {
57  /* pqXXXXXX: User IO not defined yet. */
60 
61 typedef enum
62 {
66 
68 {
70  void *baton;
71 };
72 
73 typedef struct simple_timer_t simple_timer_t;
75 {
79  void *baton;
82 };
83 
84 typedef struct simple_child_t simple_child_t;
86 {
87  /* TODO: More is needed here. */
88  pid_t pid;
89 };
90 
92 {
95 
96  int mpm_state;
98 
102 
104 
105  /* PID -> simple_child_t map */
107 
109 
110  /* List of upcoming timers, sorted by nearest first.
111  */
112  APR_RING_HEAD(simple_timer_ring_t, simple_timer_t) timer_ring;
113 
115 };
116 
117 typedef struct simple_conn_t simple_conn_t;
119 {
129 };
130 
132 
133 /* Allocates/initializes data retained over the life of the process */
135 
136 #endif /* APACHE_MPM_SIMPLE_TYPES_H */
APR Platform Definitions.
APR-UTIL Buckets/Bucket Brigades.
APR Hash Tables.
APR Poll interface.
APR memory allocation.
APR Rings.
APR Thread Pool Library.
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:128
struct apr_thread_pool apr_thread_pool_t
Definition: apr_thread_pool.h:58
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1458
int apr_status_t
Definition: apr_errno.h:44
struct apr_hash_t apr_hash_t
Definition: apr_hash.h:52
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_time_t
Definition: apr_time.h:45
HTTP Daemon routines.
simple_poll_type_e
Definition: simple_types.h:54
@ SIMPLE_PT_CORE_IO
Definition: simple_types.h:56
@ SIMPLE_PT_USER
Definition: simple_types.h:58
@ SIMPLE_PT_CORE_ACCEPT
Definition: simple_types.h:55
apr_status_t simple_core_init_once(void)
void(* simple_io_sock_cb)(simple_core_t *sc, apr_socket_t *sock, int flags, void *baton)
Definition: simple_types.h:46
simple_core_t * simple_core_get(void)
void(* simple_timer_cb)(simple_core_t *sc, void *baton)
Definition: simple_types.h:45
void(* simple_io_file_cb)(simple_core_t *sc, apr_socket_t *sock, int flags, void *baton)
Definition: simple_types.h:48
simple_spawn_type_e
Definition: simple_types.h:62
@ SIMPLE_SPAWN_EXEC
Definition: simple_types.h:64
@ SIMPLE_SPAWN_FORK
Definition: simple_types.h:63
Definition: apr_arch_poll_private.h:157
Definition: apr_poll.h:109
Definition: apr_arch_networkio.h:37
Definition: apr_arch_thread_mutex.h:28
Structure to store things which are per connection.
Definition: httpd.h:1193
A structure to contain connection state information.
Definition: httpd.h:1340
Definition: simple_types.h:86
pid_t pid
Definition: simple_types.h:88
Definition: simple_types.h:119
apr_socket_t * sock
Definition: simple_types.h:122
conn_rec * c
Definition: simple_types.h:124
apr_pool_t * pool
Definition: simple_types.h:120
simple_core_t * sc
Definition: simple_types.h:121
conn_state_t cs
Definition: simple_types.h:128
apr_bucket_alloc_t * ba
Definition: simple_types.h:123
apr_pollfd_t pfd
Definition: simple_types.h:126
Definition: simple_types.h:92
int mpm_state
Definition: simple_types.h:96
apr_pollcb_t * pollcb
Definition: simple_types.h:108
int run_single_process
Definition: simple_types.h:99
int run_foreground
Definition: simple_types.h:100
APR_RING_HEAD(simple_timer_ring_t, simple_timer_t) timer_ring
int restart_num
Definition: simple_types.h:97
simple_spawn_type_e spawn_via
Definition: simple_types.h:101
simple_proc_mgr_t procmgr
Definition: simple_types.h:103
apr_hash_t * children
Definition: simple_types.h:106
apr_pool_t * pool
Definition: simple_types.h:93
apr_thread_pool_t * workers
Definition: simple_types.h:114
apr_thread_mutex_t * mtx
Definition: simple_types.h:94
Definition: simple_types.h:32
int max_requests_per_child
Definition: simple_types.h:35
int thread_count
Definition: simple_types.h:34
int proc_count
Definition: simple_types.h:33
Definition: simple_types.h:68
void * baton
Definition: simple_types.h:70
simple_poll_type_e type
Definition: simple_types.h:69
Definition: simple_types.h:75
void * baton
Definition: simple_types.h:79
APR_RING_ENTRY(simple_timer_t) link
simple_core_t * sc
Definition: simple_types.h:81
apr_time_t expires
Definition: simple_types.h:77
apr_pool_t * pool
Definition: simple_types.h:80
simple_timer_cb cb
Definition: simple_types.h:78