Commit Graph

36 Commits

Author SHA1 Message Date
f652ab1521 Configurable ImageIO output format (#318)
* Added the possibility to provide ImageIO's output format in the TYPE string.
For instance:
TYPE=png image/png
TYPE=png image/png png256
TYPE=png image/png png24
TYPE=png image/png png

* Removed useless comments.
Added documentation for output format.

* Added tests for 'webp' output format

* Also added tests for 'png32' output format

* Fix 'webp' sums vary based on version

* Add JPG & use multiple layers on example-map

---------

Co-authored-by: Tim <autintim@gmail.com>
2023-07-20 23:41:18 +02:00
6e20fba5e9 Generate config files and directories with CMake (#316)
* Generate config files and directories with CMake

CMake >= 3.13 required due to 'https://cmake.org/Bug/view.php?id=14444'

* Update CI pipeline
2023-07-20 23:34:21 +02:00
f521540df1 Allow renderd* sections to follow map sections in renderd.conf (#308)
* Allow `renderd*` sections to precede `map` sections in config file

* Adding test

* astyle formatting
2023-03-09 15:58:00 +00:00
28a3d0faa2 Allow for iniparser.h in either iniparser.h or iniparser/iniparser.h 2023-02-19 08:25:15 +00:00
296f888752 Resolve various compiler warnings and errors (#279)
* Resolved warnings in `src/daemon.c`

I.E.:
```
src/daemon.c:835:16: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   char *name = iniparser_getsecname(ini, section);
                ^~~~~~~~~~~~~~~~~~~~
src/daemon.c:860:20: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    char *ini_uri = iniparser_getstring(ini, buffer, (char *)"");
                    ^~~~~~~~~~~~~~~~~~~
```

* Resolved warning in `src/mod_tile.c`

I.E.:
```
./src/mod_tile.c:327:53: warning: format '%d' expects argument of type 'int', but argument 9 has type 'long unsigned int' [-Wformat=]
      ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, "request_tile: Failed to read response from rendering socket. Got %d bytes but expected %d. Errno %d (%s)",
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             ret, sizeof(struct protocol_v2), errno, strerror(errno));
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
                  |
                  long unsigned int
```

* Resolved `cppcheck`-detected error

I.E.:
```
src/store_rados.c:355:3: error: Memory leak: store [memleak]
  return NULL;
  ^
```

* Fix `Does not check for buffer overflows (CWE-120)` in `src/daemon.c`

* Fix `Does not check for buffer overflows (CWE-120)` in `src/cache_expire.c`

* Resolved `cppcheck`-detected error

I.E.:
```
src/parameterize_style.cpp:43:3: error: Memory leak: data [memleak]
  return;        //No parameterization given
  ^

* url is `char *`, unlike buffer, size is not known
2022-05-29 18:29:21 +00:00
42e4f0d283 Added PID file path configurability (#282)
* Added PID file path configurability
2022-05-26 20:36:54 +00:00
52308d7996 Updated GitHub Actions job definitions (#277)
* Fixing "Lint with `astyle`" job
2022-05-26 20:35:14 +00:00
9d34dd8044 Updated Usage to reflect recent change allowing TCP for tools (#273)
* Updated `Usage` to reflect recent change allowing TCP for tools as well as "description" alignment
2022-05-06 16:10:01 +00:00
50afe3e351 Fix compile errors on FreeBSD (#268)
* Fix compile errors on FreeBSD

Co-authored-by: Michael Schmiedgen <root@maps.takwa.de>
2022-01-06 20:24:44 +00:00
9d9bfc1c84 Change logging level for empty/absent parameterize_style to DEBUG
Shown once per thread:
```
** INFO: 04:05:50.327: Loading parameterization function for
```

Fixed two minor grammar issues: `to` => `too`
2021-08-18 19:47:57 +02:00
a14924a999 Logging Improvements
* Using [`GLib Logging Framework`](https://developer.gnome.org/programming-guidelines/stable/logging.html.en) for logging
  * Created new `g_logger` function for logging
    * Outputs to `stdout`/`stderr` only when running in `foreground`
      * `stderr` for `message`, `warning`, `critical` & `error` levels
      * `stdout` for `debug` & `info` levels
        * Use `G_MESSAGES_DEBUG=all` environment to enable `debug` to print
    * Otherwise, output will be to `syslog` or `systemd journal` (when appropriate)
* Standardized usage of `{LOG_PRIORITY}: ` prefix in log messages
  * Only when using `syslog`, otherwise `GLib Logging` will take care of it
* Changed `fprintf(stderr`, `printf` & `perror` calls to `g_logger` calls
  * You might want to check them out closely to make sure I chose the right levels
  * No changes to `logging/output` were made to "`foreground`" programs (I.E. `render_*`)
* Changed `0`,`1` to `no_argument`,`required_argument` in `getopt_long`'s `long_options`
  * Fixed `renderd`'s `foreground` opt (should be `no_argument` [0] rather than `reguired_argument` [1])
* Basic test for `mod_tile` module
* ~~Extended `renderd` log priority onto Mapnik's logger~~
2021-07-28 14:46:50 +00:00
891ed80a83 Replace select() by poll().
select() has a well-known limit and the maximum file descriptor
that can be used (FD_SETSIZE). On Linux it is in most cases 1024.

Our renderd uses a lot of planet tiff files, so it had already
more than 1600 FDs for tiff files open. That means any new FD gets a
number bigger than that and using such FDs in select() leads to crashes
(because select() uses a fixed size bitmap).

The same can happen in mod_tile if the surounding web server is very
busy, altough it is less likely to happen there.

Changes in src/mod_tile.c:
- include poll.h
- poll timeout is an int containing miliseconds
- use "s > 0" instead of "s == 1" as success
  (although it should never be >1)
- different log message for timeout and error case

Changes in src/daemon.c:
- remove include for sys/select.h
- replace connections array by new array pfd used in poll()
- include special FDs (exit and listen) at index 0 and 1 in this array
- no longer reorganize array while iteratig through it.
  That would have led to items being skipped.
  Instead mark array slots with fixed connections with
  a negative FD. These are automatically skipped by poll.
  Reuse these slots later when new connections come in.
- rename num_connections to num_cslots (initial segment
  of the array that poll() should check) and
  num_conns (number of slots in this segment, that are
  actually used by connections; this number is only
  used in logging).
- slightly enhance debug log lines
2021-07-13 16:22:40 +00:00
48000f2679 Fixed issue were renderd does not send a response for low priority queue 2021-02-15 20:49:12 +00:00
648913dec9 Formatted code as per Linux style 2021-02-15 19:20:30 +01:00
8833bba9a2 Drop internal iniparser 2021-02-15 17:10:43 +01:00
d706d96020 Clarify copyright holders 2020-10-09 15:20:37 +00:00
8d711039c8 Merge pull request #213 from xamanu/run-for-deamon
Adhere to FHS 3.0 and use daemon under /run.
2020-09-24 11:24:05 +01:00
a2696f3901 Merge branch 'spelling-errors' of git://github.com/xamanu/mod_tile into xamanu-spelling-errors 2020-09-24 11:19:49 +01:00
de41cb1392 Adhere to FHS 3.0 and use daemon under /run. 2020-09-03 19:32:31 +00:00
3a78a312ed Fix spelling errors.
* recieve   -> receive
* accross   -> across
* determins -> determines
* reqyest   -> request

Gbp-Pq: Name spelling-errors.patch
2020-09-02 15:07:46 +00:00
a22065b8ae Move variables to prevent duplicates 2020-05-23 12:42:07 +01:00
6b9611aaf7 Fix another compile warning 2015-05-25 23:45:08 +01:00
8307d19ab7 Fix lots of compilation warnings 2015-05-25 21:58:27 +01:00
34dbe66acb Merge pull request #82 from Zverik/retina
SCALE option to produce retina tiles
2014-07-09 12:56:12 -06:00
7e9abfbb29 SCALE option to produce retina tiles 2014-07-09 18:23:41 +04:00
6600d38a54 Extend autoconf and automake to use an installed libiniparser
This helps systems with newer (and therefore relying on libiniparser) samba versions installed.
2014-05-29 08:56:52 +02:00
9d4e10e7c0 Parameterization options and mime type of renderd protocol 3 were not passed to slave threads
Expand some socket debuging information
2014-05-18 11:32:22 -06:00
13da3afe70 render_list was not blocking on requests and would swamp renderd with requests 2013-12-24 01:03:20 +01:00
66e5538dc4 fix gcc errors 2013-12-05 17:47:04 +01:00
99357a53ab Improve backwards and forward compatibility for renderd protocol v3/v2 2013-10-20 16:03:32 -06:00
c4aabc5701 Enable mapnik style parameterization
Provide a parameterization function for internationalizing the names
2013-10-13 23:26:31 -06:00
5941e23ced Support options for tile layers in mod_tile.
If a tile layer has options enabled, the URL changes to

http://localhost/style/options/z/x/y.ext
2013-10-13 23:23:10 -06:00
fdc317a8f3 Update mod_tile to renderd protocol to version 3.
Include an "options" string and a "mimetype" string.
2013-10-13 23:22:08 -06:00
3b2fcd5ba2 Fix sending back NotDone from renderd immediately if
request doesn't fit into a rendering queue

RenderPrio, Render and RenderLow queues each only have a size of 32 entries. If these are full,
then requests overflow into the dirty queue. If this happens, renderd should send the NotDone
back immediately so that mod_tile doesn't wait for potentially a long time.

This however only worked for Render requests, but not RenderPrio or RenderLow. This patch fixes this.
2013-08-29 00:34:56 -06:00
1b4c56d8ed Add another priority level (RenderLow) to accommodate rerenders after style changes
In addition to Render and RenderPrio, add another priority level of RenderLow.

The idea is that if you rerender all tiles by touching planet-import-complete and
thereby likely overloading the server's rendering capacity you want to prioritize rerendering
of tiles that were explicitly marked dirty due to data changes over rerendering
due to planet-import-complete updates.

This is achieved by splitting rendering requests by if they are "old", or "very old".
As the tile expiry sets back the modification date many years, mod_tile splits
rendering requests based on how old the tiles are. If they are no more than a
certain threshold (currently set to one year) old, they are rendered with lower priority.
2013-08-10 23:05:28 -06:00
273973ed03 Clean up mod_tile directory by moving source files into a common src/ sub directory
also move includes into includes/
2013-08-09 18:46:10 -06:00