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

Last change on this file since 28629 was 28516, checked in by Dirk Stoecker, 7 years ago

finally remove hardcoded tile path and replace it by config option

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 FRESH 1
19#define OLD 2
20#define FRESH_RENDER 3
21#define OLD_RENDER 4
22
23/* Number of microseconds to camp out on the mutex */
24#define CAMPOUT 10
25/* Maximum number of times we camp out before giving up */
26#define MAXCAMP 10
27
28#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>"
29
30typedef struct delaypool_entry {
31        in_addr_t ip_addr;
32        int available_tiles;
33        int available_render_req;
34} delaypool_entry;
35
36typedef struct delaypool {
37        delaypool_entry users[DELAY_HASHTABLE_SIZE];
38        in_addr_t whitelist[DELAY_HASHTABLE_WHITELIST_SIZE];
39        apr_time_t last_tile_fillup;
40        apr_time_t last_render_fillup;
41        int locked;
42} delaypool;
43
44typedef struct stats_data {
45    apr_uint64_t noResp200;
46    apr_uint64_t noResp304;
47    apr_uint64_t noResp404;
48        apr_uint64_t noResp503;
49    apr_uint64_t noResp5XX;
50    apr_uint64_t noRespOther;
51    apr_uint64_t noFreshCache;
52    apr_uint64_t noFreshRender;
53    apr_uint64_t noOldCache;
54    apr_uint64_t noOldRender;
55        apr_uint64_t noRespZoom[MAX_ZOOM + 1];
56    apr_uint64_t *noResp200Layer;
57    apr_uint64_t *noResp404Layer;
58} stats_data;
59
60typedef struct {
61    char xmlname[XMLCONFIG_MAX];
62    char baseuri[PATH_MAX];
63    char fileExtension[PATH_MAX];
64    char mimeType[PATH_MAX];
65    char * description;
66    char * attribution;
67    char **hostnames;
68    int noHostnames;
69    int minzoom;
70    int maxzoom;
71} tile_config_rec;
72
73typedef struct {
74    apr_array_header_t *configs;
75    int request_timeout;
76        int request_timeout_priority;
77    int max_load_old;
78    int max_load_missing;
79    int cache_duration_dirty;
80    int cache_duration_max;
81    int cache_duration_minimum;
82    int cache_duration_low_zoom;
83    int cache_level_low_zoom;
84    int cache_duration_medium_zoom;
85    int cache_level_medium_zoom;
86    double cache_duration_last_modified_factor;
87    char renderd_socket_name[PATH_MAX];
88    char tile_dir[PATH_MAX];
89        char cache_extended_hostname[PATH_MAX];
90    int  cache_extended_duration;
91    int mincachetime[MAX_ZOOM + 1];
92    int enableGlobalStats;
93        int enableTileThrottling;
94        int delaypoolTileSize;
95        long delaypoolTileRate;
96        int delaypoolRenderSize;
97        long delaypoolRenderRate;
98    int bulkMode;
99} tile_server_conf;
100
101typedef struct tile_request_data {
102        struct protocol * cmd;
103        int layerNumber;
104} tile_request_data;
105
106enum tileState { tileMissing, tileOld, tileCurrent };
107
108
109#endif
Note: See TracBrowser for help on using the repository browser.