File: server_8h-source.html

package info (click to toggle)
klone 1.1.1.dfsg1-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 6,480 kB
  • ctags: 4,238
  • sloc: ansic: 16,288; makefile: 384; sh: 351
file content (87 lines) | stat: -rw-r--r-- 6,843 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>KLone: server.h Source File</title>
<link href="kl.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.9.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<div class="nav">
<a class="el" href="dir_000002.html">klone</a></div>
<h1>server.h</h1><a href="server_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
00002 <span class="comment"> * Copyright (c) 2005, 2006 by KoanLogic s.r.l. &lt;http://www.koanlogic.com&gt;</span>
00003 <span class="comment"> * All rights reserved.</span>
00004 <span class="comment"> *</span>
00005 <span class="comment"> * This file is part of KLone, and as such it is subject to the license stated</span>
00006 <span class="comment"> * in the LICENSE file which you have received as part of this distribution.</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> * $Id: server.h,v 1.16 2006/01/09 12:38:38 tat Exp $</span>
00009 <span class="comment"> */</span>
00010 
00011 <span class="preprocessor">#ifndef _KLONE_SERVER_H_</span>
00012 <span class="preprocessor"></span><span class="preprocessor">#define _KLONE_SERVER_H_</span>
00013 <span class="preprocessor"></span>
00014 <span class="preprocessor">#include "klone_conf.h"</span>
00015 <span class="preprocessor">#include &lt;<a class="code" href="ppc_8h.html">klone/ppc.h</a>&gt;</span>
00016 <span class="preprocessor">#include &lt;<a class="code" href="klog_8h.html">klone/klog.h</a>&gt;</span>
00017 
00018 <span class="preprocessor">#ifdef __cplusplus</span>
00019 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00020 <span class="preprocessor">#endif</span>
00021 <span class="preprocessor"></span>
00022 <span class="keyword">struct </span>u_config_s;
00023 <span class="keyword">struct </span><a class="code" href="structserver__s.html">server_s</a>;
<a name="l00024"></a><a class="code" href="server_8h.html#a0">00024</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structserver__s.html">server_s</a> <a class="code" href="server_8h.html#a0">server_t</a>;
00025 
00026 <span class="keyword">enum</span> { 
00027     <a class="code" href="server_8h.html#a19a1">SERVER_LOG_FLUSH_TIMEOUT</a> = 5,   <span class="comment">/* min # of seconds between two log flush */</span>
00028 
00029     <span class="comment">/* fork/prefork */</span>
00030     <a class="code" href="server_8h.html#a19a2">SERVER_MAX_CHILD</a> = 300,         <span class="comment">/* total # of child process per-server    */</span>
00031     <a class="code" href="server_8h.html#a19a3">SERVER_MAX_BACKEND_CHILD</a> = 150, <span class="comment">/* max # of child allowed to run at once </span>
00032 <span class="comment">                                       per-backend */</span>
00033 
00034     <span class="comment">/* prefork server model limits */</span>
00035     <a class="code" href="server_8h.html#a19a4">SERVER_PREFORK_START_CHILD</a> = 2, <span class="comment">/* # of child to run on startup           */</span>
00036     <a class="code" href="server_8h.html#a19a5">SERVER_PREFORK_MAX_RQ_CHILD</a> = 10000 <span class="comment">/* max # of rq a process can serve    */</span>
00037 };
00038 
00039 <span class="keyword">enum</span> { 
00040     SERVER_MODEL_UNSET,     <span class="comment">/* uninitialized                                */</span>
00041     SERVER_MODEL_FORK,      <span class="comment">/* fork for each incoming connection            */</span>
00042     SERVER_MODEL_ITERATIVE, <span class="comment">/* serialize responses                          */</span>
00043     SERVER_MODEL_PREFORK,   <span class="comment">/* prefork a few child to serve more clients    */</span>
00044 <span class="preprocessor">    #ifdef OS_UNIX</span>
00045 <span class="preprocessor"></span>    <a class="code" href="server_8h.html#a20a10">SERVER_MODEL_DEFAULT</a> = <a class="code" href="server_8h.html#a20a9">SERVER_MODEL_PREFORK</a>
00046 <span class="preprocessor">    #else</span>
00047 <span class="preprocessor"></span>    <a class="code" href="server_8h.html#a20a10">SERVER_MODEL_DEFAULT</a> = <a class="code" href="server_8h.html#a20a8">SERVER_MODEL_ITERATIVE</a>
00048 <span class="preprocessor">    #endif</span>
00049 <span class="preprocessor"></span>};
00050 
00051 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a11">server_create</a>(<span class="keyword">struct</span> u_config_s *config, <span class="keywordtype">int</span> model, server_t **ps);
00052 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a12">server_free</a>(server_t *s);
00053 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a13">server_loop</a>(server_t *s);
00054 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a14">server_cgi</a>(server_t *s);
00055 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a15">server_stop</a>(server_t *s);
00056 <a class="code" href="ppc_8h.html#a0">ppc_t</a>* <a class="code" href="server_8h.html#a16">server_get_ppc</a>(server_t *s);
00057 
00058 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a17">server_get_logger</a>(server_t *s, <a class="code" href="structklog__s.html">klog_t</a> **pkl);
00059 <span class="keywordtype">int</span> <a class="code" href="server_8h.html#a18">server_foreach_memlog_line</a>(server_t *s, <span class="keywordtype">int</span> (*cb)(<span class="keyword">const</span> <span class="keywordtype">char</span>*, <span class="keywordtype">void</span>*), 
00060     <span class="keywordtype">void</span> *arg);
00061 
00062 <span class="preprocessor">#ifdef __cplusplus</span>
00063 <span class="preprocessor"></span>}
00064 <span class="preprocessor">#endif </span>
00065 <span class="preprocessor"></span>
00066 <span class="preprocessor">#endif</span>
</pre></div><hr>
<div> 
  <div style="text-align:left">
    <a href="http://www.koanlogic.com/kl/cont/gb/html/products.html">&larr;Products</a>
  </div>
  <div style="text-align:center;">
    &copy; 2005-2006 - <a href="http://www.koanlogic.com">KoanLogic S.r.l.</a> - All rights reserved
  </div>
</div>

</body>
</html>