mod_musicindex
1.4.1
|
Tarballs generation. More...
#include "mod_musicindex.h"
#include <http_core.h>
#include <archive.h>
#include <archive_entry.h>
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | cdata |
Holds our client data for libarchive. More... |
Macros | |
#define | _FILE_OFFSET_BITS 64 |
#define | OT_SEND_DATA 0 |
trigger data sending in tarball_op() | |
#define | OT_SEND_SIZE 1 |
trigger size report in tarball_op() | |
#define | RWBUFSIZE 8192 |
Size of our r/w buffer. | |
#define | QSKIP_CHECKS(q) (!(q->flags & EF_ALLOWTARBALL)) |
Skip file if ... |
Functions | |
static int | wrapopen (struct archive *a, void *client_data) |
static ssize_t | wrapwrite (struct archive *a, void *client_data, const void *buff, size_t n) |
static ssize_t | wrapwritesize (struct archive *a, void *client_data, const void *buff, size_t n) |
static ssize_t | tarball_op (request_rec *r, const mu_pack *const pack, int op) |
Triggers tarball operation. | |
void | send_tarball (request_rec *r, const mu_pack *const pack) |
Sends tarball. | |
ssize_t | tarball_size (request_rec *r, const mu_pack *const pack) |
Compute tarball size. |
Tarballs generation.
This file handles on the fly tarball generation and associated operations
Definition in file output-tarball.c.
#define _FILE_OFFSET_BITS 64 |
Definition at line 32 of file output-tarball.c.
#define OT_SEND_DATA 0 |
trigger data sending in tarball_op()
Definition at line 51 of file output-tarball.c.
Referenced by send_tarball(), and tarball_op().
#define OT_SEND_SIZE 1 |
trigger size report in tarball_op()
Definition at line 52 of file output-tarball.c.
Referenced by tarball_size().
#define QSKIP_CHECKS | ( | q | ) | (!(q->flags & EF_ALLOWTARBALL)) |
#define RWBUFSIZE 8192 |
void send_tarball | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Sends tarball.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 176 of file output-tarball.c.
References OT_SEND_DATA, and tarball_op().
Referenced by handle_musicindex().
|
static |
Triggers tarball operation.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
op | Type of operation requested. |
It is a known "feature" that when tar'ing a custom playlist, the generated tarball will contain the full path as published on the webserver, including '/'. We could get rid of the leading '/' if needed, but there's one good reason not to put all the files at the root of one big tarball: in case there are name doublons.
Definition at line 101 of file output-tarball.c.
References mu_pack::fhead, mu_ent::file, mu_ent::filename, likely, mu_ent::next, OT_SEND_DATA, QSKIP_CHECKS, cdata::r, RWBUFSIZE, mu_ent::size, unlikely, wrapopen(), wrapwrite(), and wrapwritesize().
Referenced by send_tarball(), and tarball_size().
ssize_t tarball_size | ( | request_rec * | r, |
const mu_pack *const | pack | ||
) |
Compute tarball size.
r | Apache request_rec struct to handle connection details. |
pack | A pack of music entries. |
Definition at line 190 of file output-tarball.c.
References OT_SEND_SIZE, and tarball_op().
Referenced by handle_musicindex().
|
static |
Definition at line 65 of file output-tarball.c.
Referenced by tarball_op().
|
static |
|
static |
Definition at line 79 of file output-tarball.c.
Referenced by tarball_op().