mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
renderd.h File Reference
#include "config.h"
#include "gen_tile.h"

Go to the source code of this file.

Classes

struct  renderd_config
 Global daemon and Mapnik runtime settings parsed from a [renderd] INI section. More...
struct  xmlconfigitem
 Per-map-style configuration parsed from a [mapname] section in renderd.conf. More...

Macros

#define INILINE_MAX   256
 Maximum length in bytes of a single INI configuration key or line buffer.
#define MAX_SLAVES   5
 Maximum number of slave renderd instances configurable alongside the master daemon.
#define RENDER_THREAD_STARTUP_TIMEOUT_SEC   5
 Startup timeout in seconds allocated per render worker thread per configured map style.

Functions

int daemon (int nochdir, int noclose)
void statsRenderFinish (int z, long time)
void request_exit (void)
 Async-signal-safe shutdown trigger waking the main poll() event loop via exit_pipe_fd.
void send_response (struct item *item, enum protoCmd rsp, int render_time)
 Complete a metatile render request, notify all waiting clients, and free its queue items.
enum protoCmd rx_request (struct protocol *req, int fd)
 Normalize, validate, and enqueue an incoming wire protocol render or dirty request.

Variables

struct request_queue * render_request_queue
 Global thread-safe render request queue shared by network I/O, local workers, and slave threads.

Macro Definition Documentation

◆ INILINE_MAX

#define INILINE_MAX   256

Maximum length in bytes of a single INI configuration key or line buffer.

◆ MAX_SLAVES

#define MAX_SLAVES   5

Maximum number of slave renderd instances configurable alongside the master daemon.

◆ RENDER_THREAD_STARTUP_TIMEOUT_SEC

#define RENDER_THREAD_STARTUP_TIMEOUT_SEC   5

Startup timeout in seconds allocated per render worker thread per configured map style.

Function Documentation

◆ daemon()

int daemon ( int nochdir,
int noclose )

◆ request_exit()

void request_exit ( void )

Async-signal-safe shutdown trigger waking the main poll() event loop via exit_pipe_fd.

May be invoked safely from POSIX signal handlers (SIGINT, SIGTERM, SIGHUP) as well as worker threads encountering fatal startup errors.

◆ rx_request()

enum protoCmd rx_request ( struct protocol * req,
int fd )

Normalize, validate, and enqueue an incoming wire protocol render or dirty request.

Upgrades protocol v1/v2 packets to v3 defaults, validates the command opcode, allocates a struct item, aligns (x, y) coordinates down to the METATILE grid origin (mx, my), and inserts the item into render_request_queue.

Parameters
reqParsed wire protocol request received from a client socket.
fdConnected client socket descriptor (ignored/set to FD_INVALID for cmdDirty).
Returns
Resulting queue status opcode (cmdIgnore when queued/coalesced, cmdDone if already satisfied, or cmdNotDone on validation/allocation/queue-full error).

◆ send_response()

void send_response ( struct item * item,
enum protoCmd rsp,
int render_time )

Complete a metatile render request, notify all waiting clients, and free its queue items.

Removes item from render_request_queue, iterates through item and its coalesced duplicates chain, sends rsp (cmdDone or cmdNotDone) over each valid client socket awaiting a synchronous render, and frees every struct item node.

Parameters
itemHead of the completed metatile request (and duplicate subscriber) chain.
rspCompletion status opcode (cmdDone or cmdNotDone).
render_timeElapsed metatile render duration in milliseconds (or -1 if delegated/not rendered).

◆ statsRenderFinish()

void statsRenderFinish ( int z,
long time )

Variable Documentation

◆ render_request_queue

struct request_queue* render_request_queue
extern

Global thread-safe render request queue shared by network I/O, local workers, and slave threads.