source: subversion/applications/utils/mod_tile/mod_tile.h @ 28718

Last change on this file since 28718 was 28718, checked in by apmon, 7 years ago

[mod_tile] Support tile throttling with IPv6 as well

File size: 3.1 KB
Line 
1#ifndef MODTILE_H
2#define MODTILE_H
3
4/*Size of the delaypool hashtable*/
5#define DELAY_HASHTABLE_SIZE 100057
6#define DELAY_HASHTABLE_WHITELIST_SIZE 13
7/*Number of tiles in the bucket */
8#define AVAILABLE_TILE_BUCKET_SIZE 5000
9/*Number of render request in the bucket */
10#define AVAILABLE_RENDER_BUCKET_SIZE 65
11/*Number of microseconds per render request. Currently set at no more than 1 render request per 5 seconds on average */
12#define RENDER_TOPUP_RATE 5000000l
13/*Number of microseconds per render request. Currently set at no more than 1 request per second on average */
14#define TILE_TOPUP_RATE 1000000l
15
16#define INILINE_MAX 256
17
18#define MAX_ZOOM_SERVER 30
19
20#define FRESH 1
21#define OLD 2
22#define FRESH_RENDER 3
23#define OLD_RENDER 4
24
25/* Number of microseconds to camp out on the mutex */
26#define CAMPOUT 10
27/* Maximum number of times we camp out before giving up */
28#define MAXCAMP 10
29
30#define DEFAULT_ATTRIBUTION "&copy;<a href=\"http://www.openstreetmap.org/\">OpenStreetMap</a> and <a href=\"http://wiki.openstreetmap.org/wiki/Contributors\">contributors</a>, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>"
31
32typedef struct delaypool_entry {
33        struct in6_addr ip_addr;
34        int available_tiles;
35        int available_render_req;
36} delaypool_entry;
37
38typedef struct delaypool {
39        delaypool_entry users[DELAY_HASHTABLE_SIZE];
40        in_addr_t whitelist[DELAY_HASHTABLE_WHITELIST_SIZE];
41        apr_time_t last_tile_fillup;
42        apr_time_t last_render_fillup;
43        int locked;
44} delaypool;
45
46typedef struct stats_data {
47    apr_uint64_t noResp200;
48    apr_uint64_t noResp304;
49    apr_uint64_t noResp404;
50        apr_uint64_t noResp503;
51    apr_uint64_t noResp5XX;
52    apr_uint64_t noRespOther;
53    apr_uint64_t noFreshCache;
54    apr_uint64_t noFreshRender;
55    apr_uint64_t noOldCache;
56    apr_uint64_t noOldRender;
57        apr_uint64_t noRespZoom[MAX_ZOOM_SERVER + 1];
58    apr_uint64_t *noResp200Layer;
59    apr_uint64_t *noResp404Layer;
60} stats_data;
61
62typedef struct {
63    char xmlname[XMLCONFIG_MAX];
64    char baseuri[PATH_MAX];
65    char fileExtension[PATH_MAX];
66    char mimeType[PATH_MAX];
67    const char * description;
68    const char * attribution;
69    char **hostnames;
70    int noHostnames;
71    int minzoom;
72    int maxzoom;
73} tile_config_rec;
74
75typedef struct {
76    apr_array_header_t *configs;
77    int request_timeout;
78        int request_timeout_priority;
79    int max_load_old;
80    int max_load_missing;
81    int cache_duration_dirty;
82    int cache_duration_max;
83    int cache_duration_minimum;
84    int cache_duration_low_zoom;
85    int cache_level_low_zoom;
86    int cache_duration_medium_zoom;
87    int cache_level_medium_zoom;
88    double cache_duration_last_modified_factor;
89    char renderd_socket_name[PATH_MAX];
90    char tile_dir[PATH_MAX];
91        char cache_extended_hostname[PATH_MAX];
92    int  cache_extended_duration;
93    int mincachetime[MAX_ZOOM_SERVER + 1];
94    int enableGlobalStats;
95        int enableTileThrottling;
96        int delaypoolTileSize;
97        long delaypoolTileRate;
98        int delaypoolRenderSize;
99        long delaypoolRenderRate;
100    int bulkMode;
101} tile_server_conf;
102
103typedef struct tile_request_data {
104        struct protocol * cmd;
105        int layerNumber;
106} tile_request_data;
107
108enum tileState { tileMissing, tileOld, tileCurrent };
109
110
111#endif
Note: See TracBrowser for help on using the repository browser.