Plugin: New interface for STAGE 40, it allows async calls to read
[MonkeyD.git] / HowItUsedToWork.txt
blob281ccfcaf9978bbfb51506db8e349085b2043a0a
1 HOWITWORKS - Monkey >= 0.5.x
2 ============================
3 Date        : 20 Sept 2002
4 Last Update : Initial version
6 Note: I don't write or speak english very well :P .
8 Here I hope to explain how monkey works. This isn't a set design, this
9 design has been changing with time and will continue to change :) .
11 Sections
12 --------
13         1) Starting and setting
14         2) Accepting and processing new connections
15         3) comming soon...
18 1) Starting and setting
19 -----------------------
20 In this section i will explain what monkey does at the beginning.
22         Starting monkey ->|
23                           |
24                 +----------------------+ <- file: monkey.c
25                 +    Reading options   +    func: main();
26                 +   from command line  +        
27                 +----------------------+
28                           |
29                 +----------------------+ <- file: monkey.c, config.c
30                 + Reading config files +    func: main();           
31                 +----------------------+          |->Monkey_Read_Config();
32                           |
33                           |
34                 +----------------------+ <- file: monkey.c, signals.c
35                 +   Starting signals   +    func: main();
36                 +----------------------+          |->Init_Signals();
37                           |
38                           |
39                 +----------------------+ <- file: monkey.c
40                 +    Setting socket    +    func: main();       
41                 +----------------------+
42                           |
43                 +----------------------+ <- file: monkey.c
44                 +    Setting threads   +    func: main();
45                 +      properties      +        
46                 +----------------------+
47                           |
48                 +----------------------+ <- file: monkey.c, utils.c
49                 +   Changing mode to   +    func: main();
50                 +    daemon if it was  +          |->set_daemon();
51                 +     specicated       +
52                 +----------------------+
53                           |
54                 +----------------------+ <- file: monkey.c, logfile.c
55                 +     Register PID     +    func: main();
56                 +      of process      +          |->add_log_pid();
57                 +----------------------+
58                           |
59                 +----------------------+ <- file: monkey.c
60                 +  Starting main loop  +    func: main();
61                 +   and waiting for    +
62                 +   new connections    +
63                 +----------------------+
65 2) Accepting and processing new connections
66 ------------------------------------------
67 When a new connection comes, monkey follows the next steps.
70                 +----------------------+ <- file: monkey.c, deny.c
71                 +   Checking IP from   +    func: main();
72                 +   remote machine to  +          |->Deny_Check();
73                 +   know if this is    +
74                 +   not blocked in our +
75                 +   monkey.deny file   +
76                 +----------------------+
77                           |
78                 +----------------------+ <- file: monkeu.c
79                 +   Checking how many  +    func: main();
80                 +   request are being  +
81                 +  processed by monkey +
82                 +----------------------+
83                           |
84                 +----------------------+ <- file: monkey.c
85                 +  Passing connection  +    func: main();
86                 +   to a new thread    +          |->thread_init();
87                 +----------------------+
88                           |
89                 +----------------------+ <- file: monkey.c, request.c
90                 +   Reciving request   +    func: thread_init();
91                 +    and processing    +          |->Request_Main();
92                 +----------------------+