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

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

[mod_tile] Fix missing commas in tilejson spec

Also change the default attribution to reflect the change to ODbL

File size: 3.2 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://opendatacommons.org/licenses/odbl/\">(ODbL)</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    const char * cors;
70    char **hostnames;
71    int noHostnames;
72    int minzoom;
73    int maxzoom;
74} tile_config_rec;
75
76typedef struct {
77    apr_array_header_t *configs;
78    int request_timeout;
79        int request_timeout_priority;
80    int max_load_old;
81    int max_load_missing;
82    int cache_duration_dirty;
83    int cache_duration_max;
84    int cache_duration_minimum;
85    int cache_duration_low_zoom;
86    int cache_level_low_zoom;
87    int cache_duration_medium_zoom;
88    int cache_level_medium_zoom;
89    double cache_duration_last_modified_factor;
90    char renderd_socket_name[PATH_MAX];
91    char tile_dir[PATH_MAX];
92        char cache_extended_hostname[PATH_MAX];
93    int  cache_extended_duration;
94    int mincachetime[MAX_ZOOM_SERVER + 1];
95    int enableGlobalStats;
96        int enableTileThrottling;
97    int enableTileThrottlingXForward;
98        int delaypoolTileSize;
99        long delaypoolTileRate;
100        int delaypoolRenderSize;
101        long delaypoolRenderRate;
102    int bulkMode;
103} tile_server_conf;
104
105typedef struct tile_request_data {
106        struct protocol * cmd;
107        int layerNumber;
108} tile_request_data;
109
110enum tileState { tileMissing, tileOld, tileCurrent };
111
112
113#endif
Note: See TracBrowser for help on using the repository browser.