Skip to content

Commit daa0172

Browse files
authored
Backporting a few more minor changes (#449)
In order to reduce differences between `v0.7.x` and default branch.
1 parent 521e47b commit daa0172

42 files changed

Lines changed: 332 additions & 414 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile.am

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ ACLOCAL_AMFLAGS = -I m4
55
AM_CPPFLAGS = $(PTHREAD_CFLAGS) $(GLIB_CFLAGS)
66

77
STORE_SOURCES = \
8+
src/g_logger.c \
89
src/store.c \
910
src/store_file.c \
1011
src/store_file_utils.c \
1112
src/store_memcached.c \
13+
src/store_null.c \
1214
src/store_rados.c \
13-
src/store_ro_http_proxy.c \
1415
src/store_ro_composite.c \
15-
src/store_null.c \
16-
src/g_logger.c
16+
src/store_ro_http_proxy.c
1717
STORE_LDFLAGS = $(LIBMEMCACHED_LDFLAGS) $(LIBRADOS_LDFLAGS) $(LIBCURL) $(GLIB_LIBS)
1818

1919
STORE_CPPFLAGS =
@@ -22,8 +22,8 @@ bin_PROGRAMS = \
2222
renderd \
2323
render_expired \
2424
render_list \
25-
render_speedtest \
26-
render_old
25+
render_old \
26+
render_speedtest
2727
noinst_PROGRAMS = gen_tile_test
2828

2929
man_MANS = \
@@ -37,33 +37,33 @@ man_MANS = \
3737
renderddir = $(sysconfdir)
3838

3939
renderd_SOURCES = \
40-
src/daemon.c \
40+
src/renderd.c \
41+
src/cache_expire.c \
4142
src/daemon_compat.c \
4243
src/gen_tile.cpp \
43-
src/sys_utils.c \
44-
src/request_queue.c \
45-
src/cache_expire.c \
4644
src/metatile.cpp \
4745
src/parameterize_style.cpp \
4846
src/protocol_helper.c \
47+
src/request_queue.c \
48+
src/sys_utils.c \
4949
$(STORE_SOURCES)
5050
renderd_CXXFLAGS = $(MAPNIK_CFLAGS)
51-
renderd_LDADD = $(PTHREAD_CFLAGS) $(MAPNIK_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS)
5251
renderd_DATA = etc/renderd/renderd.conf
52+
renderd_LDADD = $(PTHREAD_CFLAGS) $(MAPNIK_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS)
5353

5454
render_speedtest_SOURCES = \
55-
src/speedtest.cpp \
55+
src/render_speedtest.cpp \
56+
src/g_logger.c \
5657
src/protocol_helper.c \
5758
src/render_submit_queue.c \
58-
src/sys_utils.c \
59-
src/g_logger.c
59+
src/sys_utils.c
6060
render_speedtest_LDADD = $(PTHREAD_CFLAGS) $(GLIB_LIBS)
6161

6262
render_list_SOURCES = \
6363
src/render_list.c \
64-
src/sys_utils.c \
6564
src/protocol_helper.c \
6665
src/render_submit_queue.c \
66+
src/sys_utils.c \
6767
$(STORE_SOURCES)
6868
render_list_LDADD = $(PTHREAD_CFLAGS) $(STORE_LDFLAGS)
6969

@@ -76,28 +76,19 @@ render_expired_SOURCES = \
7676
render_expired_LDADD = $(PTHREAD_CFLAGS) $(STORE_LDFLAGS)
7777

7878
render_old_SOURCES = \
79-
src/store_file_utils.c \
8079
src/render_old.c \
81-
src/sys_utils.c \
80+
src/g_logger.c \
8281
src/protocol_helper.c \
8382
src/render_submit_queue.c \
84-
src/g_logger.c
83+
src/store_file_utils.c \
84+
src/sys_utils.c
8585
render_old_LDADD = $(PTHREAD_CFLAGS) $(GLIB_LIBS)
8686

8787
#convert_meta_SOURCES = src/dir_utils.c src/store.c src/convert_meta.c
8888

8989
gen_tile_test_SOURCES = \
9090
src/gen_tile_test.cpp \
91-
src/metatile.cpp \
92-
src/request_queue.c \
93-
src/protocol_helper.c \
94-
src/daemon.c \
95-
src/daemon_compat.c \
96-
src/gen_tile.cpp \
97-
src/sys_utils.c \
98-
src/cache_expire.c \
99-
src/parameterize_style.cpp \
100-
$(STORE_SOURCES)
91+
$(renderd_SOURCES)
10192
gen_tile_test_CFLAGS = -DMAIN_ALREADY_DEFINED $(PTHREAD_CFLAGS) $(GLIB_CFLAGS)
10293
gen_tile_test_CXXFLAGS = $(MAPNIK_CFLAGS)
10394
gen_tile_test_LDADD = $(PTHREAD_CFLAGS) $(MAPNIK_LDFLAGS) $(STORE_LDFLAGS) $(INIPARSER_LDFLAGS)
@@ -114,16 +105,16 @@ all-local:
114105
$(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \
115106
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
116107
@srcdir@/src/mod_tile.c \
117-
@srcdir@/src/sys_utils.c \
108+
@srcdir@/src/g_logger.c \
118109
@srcdir@/src/store.c \
119110
@srcdir@/src/store_file.c \
120111
@srcdir@/src/store_file_utils.c \
121112
@srcdir@/src/store_memcached.c \
113+
@srcdir@/src/store_null.c \
122114
@srcdir@/src/store_rados.c \
123-
@srcdir@/src/store_ro_http_proxy.c \
124115
@srcdir@/src/store_ro_composite.c \
125-
@srcdir@/src/store_null.c \
126-
@srcdir@/src/g_logger.c
116+
@srcdir@/src/store_ro_http_proxy.c \
117+
@srcdir@/src/sys_utils.c
127118

128119
install-mod_tile:
129120
mkdir -p $(DESTDIR)`$(APXS) -q LIBEXECDIR`
@@ -132,13 +123,13 @@ install-mod_tile:
132123
$(subst -pthread,-Wc$(COMMA)-pthread,$(GLIB_CFLAGS)) \
133124
-I@srcdir@/includes $(AM_LDFLAGS) $(STORE_LDFLAGS) \
134125
@srcdir@/src/mod_tile.c \
135-
@srcdir@/src/sys_utils.c \
126+
@srcdir@/src/g_logger.c \
136127
@srcdir@/src/store.c \
137128
@srcdir@/src/store_file.c \
138129
@srcdir@/src/store_file_utils.c \
139130
@srcdir@/src/store_memcached.c \
131+
@srcdir@/src/store_null.c \
140132
@srcdir@/src/store_rados.c \
141-
@srcdir@/src/store_ro_http_proxy.c \
142133
@srcdir@/src/store_ro_composite.c \
143-
@srcdir@/src/store_null.c \
144-
@srcdir@/src/g_logger.c
134+
@srcdir@/src/store_ro_http_proxy.c \
135+
@srcdir@/src/sys_utils.c

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ when using it on an operating system this is not being packaged for.
6565
We prepared instructions for you on how to build the software on the following
6666
distributions:
6767

68-
* `CentOS </docs/build/building_on_centos.md>`__
68+
* `Arch Linux </docs/build/building_on_arch_linux.md>`__
6969
* `CentOS Stream </docs/build/building_on_centos_stream.md>`__
7070
* `Debian </docs/build/building_on_debian.md>`__
7171
* `Fedora </docs/build/building_on_fedora.md>`__

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AC_INIT([mod_tile],
1111
[http://trac.openstreetmap.org])
1212
AM_INIT_AUTOMAKE([subdir-objects])
1313
LT_INIT
14-
AC_CONFIG_SRCDIR([src/convert_meta.c])
14+
AC_CONFIG_SRCDIR([src/mod_tile.c])
1515
AC_CONFIG_HEADERS([includes/config.h])
1616
AC_CONFIG_MACRO_DIR([m4])
1717

docs/man/render_expired.1

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ render_expired \- expires a list of map tiles so that they get re-rendered.
66

77
.SH SYNOPSIS
88
.B render_expired
9-
.RI [ options ] < "expire.list"
9+
.RI [ options ]\ <\ "expire.list"
1010
.BR
1111

1212
.SH DESCRIPTION
@@ -27,13 +27,13 @@ Render_expired has three potential strategies of how to expire map tiles:
2727
These three strategies can be combined and applied at different zoom levels. E.g. Zoom level 17-18 get deleted, z11 - z16 get marked dirty and z6 - z10 get rendered directly.
2828
.PP
2929
Render_expired takes a list of tiles from stdin which should be expired. The format of the list is one tile per line specified as z/x/y.
30-
.BR
30+
.sp 0
3131
1/0/1
32-
.BR
32+
.sp 0
3333
1/1/1
34-
.BR
34+
.sp 0
3535
1/0/0
36-
.BR
36+
.sp 0
3737
1/1/0
3838
.PP
3939
render_expired will automatically expand the list to cover the effected tiles at other zoom levels.
@@ -52,24 +52,23 @@ Specify the location of the renderd socket or hostname and port to connect to.
5252
.TP
5353
\fB\-n\fR|\-\-num-threads=N
5454
Specify the number of parallel requests to renderd. Should renderd have less threads active, requests will be queued. The default is 1.
55-
default if \fB\-\-append\fR is not specified.
5655
.TP
5756
\fB\-t\fR|\-\-tile-dir=DIR
5857
Specify the base directory where the rendered tiles are. The default is '/var/cache/renderd/tiles'
5958
.TP
6059
\fB\-z\fR|\-\-min-zoom=ZOOM
61-
Filter input to only render tiles greater or equal to this zoom level (default is 0)
60+
Filter input to only render tiles greater than or equal to this zoom level (default is '0').
6261
.TP
6362
\fB\-Z\fR|\-\-max-zoom=ZOOM
64-
Filter input to only render tiles less than or equal to this zoom level (default is 18)
63+
Filter input to only render tiles less than or equal to this zoom level (default is '18').
6564
.TP
6665
\fB\-d\fR|\-\-delete-from=ZOOM
6766
When expiring tiles of ZOOM or higher, delete them instead of re-rendering (default is off)
6867
.TP
6968
\fB\-T\fR|\-\-touch-from=ZOOM
70-
when expiring tiles of ZOOM or higher, touch them instead of re-rendering (default is off)
69+
When expiring tiles of ZOOM or higher, touch them instead of re-rendering (default is off)
7170
.TP
72-
\-\-no-progress
71+
\fB\-N\fR|\-\-no-progress
7372
Disable display of progress messages (default is off)
7473
.TP
7574
\fB\-h\fR|\-\-help

docs/man/render_list.1

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ render_list \- renders a list of map tiles by sending requests to a rendering da
66

77
.SH SYNOPSIS
88
.B render_list
9-
.RI [ options ] < "render.list"
9+
.RI [ options ]\ <\ "render.list"
1010
.BR
1111

1212
.SH DESCRIPTION
@@ -30,37 +30,45 @@ Render all tiles in given zoom level range instead of reading from STDIN.
3030
Render tiles even if they seem current.
3131
.TP
3232
\fB\-m\fR|\-\-map=MAP
33-
Render tiles in this map (defaults to 'default').
33+
Render tiles in this map (default is 'default').
3434
.TP
3535
\fB\-l\fR|\-\-max-load=LOAD
36-
Sleep if load is this high (defaults to 16).
36+
Sleep if load is this high (default is '16').
3737
.TP
3838
\fB\-s\fR|\-\-socket=SOCKET|HOSTNAME:PORT
3939
Unix domain socket name or hostname and port for contacting renderd (default is '/run/renderd/renderd.sock').
4040
.TP
4141
\fB\-n\fR|\-\-num-threads=N
42-
The number of parallel request threads (default 1).
42+
The number of parallel request threads (default is '1').
4343
.TP
44-
\fB\-t\fR|\-\-tile-dir
45-
Tile cache directory (defaults to '/var/cache/renderd/tiles').
44+
\fB\-t\fR|\-\-tile-dir=TILE_DIR
45+
Tile cache directory (default is '/var/cache/renderd/tiles').
4646
.TP
4747
\fB\-z\fR|\-\-min-zoom=ZOOM
48-
Filter input to only render tiles greater or equal to this zoom level (default is 0).
48+
Filter input to only render tiles greater than or equal to this zoom level (default is '0').
4949
.TP
5050
\fB\-Z\fR|\-\-max-zoom=ZOOM
51-
Filter input to only render tiles less than or equal to this zoom level (default is 20).
51+
Filter input to only render tiles less than or equal to this zoom level (default is '20').
52+
.TP
53+
\fB\-h\fR|\-\-help
54+
Print out a help text for render_list
55+
.TP
56+
\fB\-V\fR|\-\-version
57+
Print out the version number for render_list
5258
.PP
53-
If you are using --all, you can restrict the tile range by adding these options:
54-
.BR
55-
-x, --min-x=X minimum X tile coordinate
59+
If you are using \fB\-a\fR|\-\-all, you can restrict the tile range by adding these options:
60+
.sp 0
61+
(please note that tile coordinates must be positive integers and are not latitude and longitude values)
62+
.PP
63+
\fB\-x\fR|\-\-min-x=X minimum X tile coordinate
5664
.BR
57-
-X, --max-x=X maximum X tile coordinate
65+
\fB\-X\fR|\-\-max-x=X maximum X tile coordinate
5866
.BR
59-
-y, --min-y=Y minimum Y tile coordinate
67+
\fB\-y\fR|\-\-min-y=Y minimum Y tile coordinate
6068
.BR
61-
-Y, --max-y=Y maximum Y tile coordinate
69+
\fB\-Y\fR|\-\-max-y=Y maximum Y tile coordinate
6270
.PP
63-
Without --all, send a list of tiles to be rendered from STDIN in the format:
71+
Without \fB\-a\fR|\-\-all, send a list of tiles to be rendered from STDIN in the format:
6472
.BR
6573
X Y Z
6674
.BR
@@ -73,14 +81,8 @@ e.g.
7381
1 0 1
7482
.BR
7583
1 1 1
76-
.BR
84+
.PP
7785
The above would cause all 4 tiles at zoom 1 to be rendered
78-
.TP
79-
\fB\-h\fR|\-\-help
80-
Print out a help text for render_list
81-
.TP
82-
\fB\-V\fR|\-\-version
83-
Print out the version number for render_list
8486
.PP
8587

8688
.SH SEE ALSO

includes/cache_expire.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ extern "C" {
2626
#define HTCP_EXPIRE_CACHE_PORT "4827"
2727

2828

29-
void cache_expire(int sock, char * host, char * uri, int x, int y, int z);
30-
int init_cache_expire(char * htcphost);
29+
void cache_expire(int sock, char *host, char *uri, int x, int y, int z);
30+
int init_cache_expire(char *htcphost);
3131

3232
#ifdef __cplusplus
3333
}

includes/config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#ifndef CONFIG_H
2+
#define CONFIG_H
13
/* Define to 1 if you have the functions. */
24
#cmakedefine HAVE_DAEMON @HAVE_DAEMON@
35
#cmakedefine HAVE_GETLOADAVG @HAVE_GETLOADAVG@
@@ -25,3 +27,4 @@
2527

2628
/* Version number of project */
2729
#cmakedefine VERSION "@VERSION@"
30+
#endif

includes/g_logger.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* along with this program; If not, see http://www.gnu.org/licenses/.
1616
*/
1717

18-
#ifndef GLOGGER_H
19-
#define GLOGGER_H
18+
#ifndef G_LOGGER_H
19+
#define G_LOGGER_H
2020

2121
#include <glib.h>
2222

includes/gen_tile.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@
2424
extern "C" {
2525
#endif
2626

27-
28-
enum queueEnum {queueRequest, queueRequestPrio, queueRequestBulk, queueDirty, queueRender, queueDuplicate, queueRequestLow};
27+
enum queueEnum { queueRequest,
28+
queueRequestPrio,
29+
queueRequestBulk,
30+
queueDirty,
31+
queueRender,
32+
queueDuplicate,
33+
queueRequestLow
34+
};
2935

3036
struct item {
3137
struct item *next;
@@ -38,11 +44,11 @@ struct item {
3844
enum queueEnum originatedQueue;
3945
};
4046

41-
//int render(Map &m, int x, int y, int z, const char *filename);
47+
// int render(Map &m, int x, int y, int z, const char *filename);
4248
void *render_thread(void *);
4349
struct item *fetch_request(void);
4450
void delete_request(struct item *item);
45-
void render_init(const char *plugins_dir, const char* font_dir, int font_recurse);
51+
void render_init(const char *plugins_dir, const char *font_dir, int font_recurse);
4652

4753
#ifdef __cplusplus
4854
}

0 commit comments

Comments
 (0)