Add this code to the mod_flvx.c file:
#if APR_HAS_LARGE_FILES
#define APR_OFF_T_STRFN strtoll
#else
#define APR_OFF_T_STRFN strtol
#endif
/* A "safe" maximum bucket size, 1Gb */
#define MAX_BUCKET_SIZE (0x40000000)
APU_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb,
apr_file_t *f,
apr_off_t start,
apr_off_t length,
apr_pool_t *p)
{
apr_bucket *e;
if (sizeof(apr_off_t) == sizeof(apr_size_t) || length < MAX_BUCKET_SIZE) {
e = apr_bucket_file_create(f, start, (apr_size_t)length, p,
bb->bucket_alloc);
}
else {
/* Several buckets are needed. */
e = apr_bucket_file_create(f, start, MAX_BUCKET_SIZE, p,
bb->bucket_alloc);
while (length > MAX_BUCKET_SIZE) {
apr_bucket *ce;
apr_bucket_copy(e, &ce);
APR_BRIGADE_INSERT_TAIL(bb, ce);
e->start += MAX_BUCKET_SIZE;
length -= MAX_BUCKET_SIZE;
}
e->length = (apr_size_t)length; /* Resize just the last bucket */
}
APR_BRIGADE_INSERT_TAIL(bb, e);
return e;
{
errno = 0;
*offset = APR_OFF_T_STRFN(nptr, endptr, base);
return APR_FROM_OS_ERROR(errno);
}
#if APR_HAS_LARGE_FILES
#define APR_OFF_T_STRFN strtoll
#else
#define APR_OFF_T_STRFN strtol
#endif
/* A "safe" maximum bucket size, 1Gb */
#define MAX_BUCKET_SIZE (0x40000000)
APU_DECLARE(apr_bucket *) apr_brigade_insert_file(apr_bucket_brigade *bb,
apr_file_t *f,
apr_off_t start,
apr_off_t length,
apr_pool_t *p)
{
apr_bucket *e;
if (sizeof(apr_off_t) == sizeof(apr_size_t) || length < MAX_BUCKET_SIZE) {
e = apr_bucket_file_create(f, start, (apr_size_t)length, p,
bb->bucket_alloc);
}
else {
/* Several buckets are needed. */
e = apr_bucket_file_create(f, start, MAX_BUCKET_SIZE, p,
bb->bucket_alloc);
while (length > MAX_BUCKET_SIZE) {
apr_bucket *ce;
apr_bucket_copy(e, &ce);
APR_BRIGADE_INSERT_TAIL(bb, ce);
e->start += MAX_BUCKET_SIZE;
length -= MAX_BUCKET_SIZE;
}
e->length = (apr_size_t)length; /* Resize just the last bucket */
}
APR_BRIGADE_INSERT_TAIL(bb, e);
return e;
}
APR_DECLARE(apr_status_t) apr_strtoff(apr_off_t *offset, const char *nptr, char **endptr, int base){
errno = 0;
*offset = APR_OFF_T_STRFN(nptr, endptr, base);
return APR_FROM_OS_ERROR(errno);
}