#include "mod_cache.h"
#include "apr_file_io.h"
#include "apr_strings.h"
-#include "http_config.h"
-#include "http_log.h"
#include "util_filter.h"
#include "util_script.h"
+#if APR_HAVE_UNISTD_H
+#include <unistd.h> /* needed for unlink/link */
+#endif
+
/*
* disk_cache_object_t
* Pointed to by cache_object_t::vobj
{
char *hashfile;
hashfile = generate_name(p, dirlevels, dirlength, name);
- return apr_pstrcat(p, root, "/", hashfile, CACHE_HEADER_SUFFIX);
+ return apr_pstrcat(p, root, "/", hashfile, CACHE_HEADER_SUFFIX, NULL);
}
static char *data_file(apr_pool_t *p, int dirlevels, int dirlength,
{
char *hashfile;
hashfile = generate_name(p, dirlevels, dirlength, name);
- return apr_pstrcat(p, root, "/", hashfile, CACHE_DATA_SUFFIX);
+ return apr_pstrcat(p, root, "/", hashfile, CACHE_DATA_SUFFIX, NULL);
}
static int mkdir_structure(char *file, const char *root)
obj->complete = 0; /* Cache object is not complete */
info = apr_pcalloc(r->pool, sizeof(cache_info));
- info->name = key;
+ info->name = (char *) key;
obj->info = *(info);
#ifdef AS400
{
disk_cache_conf *conf = ap_get_module_config(r->server->module_config,
&disk_cache_module);
- apr_status_t ret = DECLINED;
apr_status_t rc;
char *data = data_file(r->pool, conf->dirlevels, conf->dirlength,
conf->cache_root, key);
}
obj = apr_pcalloc(r->pool, sizeof(cache_object_t));
- obj->key = key;
+ obj->key = (char *) key;
rc = apr_file_open(&fd, data, APR_WRITE | APR_READ | APR_BINARY, 0, r->pool);
if (rc == APR_SUCCESS) {
info = apr_pcalloc(r->pool, sizeof(cache_info));
- info->name = key;
+ info->name = (char *) key;
/* XXX log message */
info->fd = fd;
info->datafile = data;
static int remove_url(const char *type, char *key)
{
+ return OK;
}
static int remove_entity(cache_handle_t *h)
}
/* XXX log */
- if(rv = file_cache_read_mydata(fd, info, r) != APR_SUCCESS) {
+ if((rv = file_cache_read_mydata(fd, info, r)) != APR_SUCCESS) {
/* XXX log message */
apr_file_close(fd);
return rv;
else {
/* XXX log message */
}
- if(rc = apr_file_open(&hfd, info->hdrsfile,
+ if((rc = apr_file_open(&hfd, info->hdrsfile,
APR_WRITE | APR_CREATE | APR_BINARY | APR_EXCL, /* XXX:? | APR_INHERIT | APR_NONQSYS, */
- 0, r->pool) != APR_SUCCESS) {
+ 0, r->pool)) != APR_SUCCESS) {
/* XXX log message */
return rc;
}
buf = apr_pstrcat(r->pool, statusbuf, CRLF, NULL);
amt = strlen(buf);
apr_file_write(hfd, buf, &amt);
- buf = apr_pstrcat(r->pool, r->status_line, '\n', NULL);
+ buf = apr_pstrcat(r->pool, r->status_line, "\n", NULL);
amt = strlen(buf);
apr_file_write(hfd, buf, &amt);
buf = apr_pstrcat(r->pool, CRLF, NULL);
* mod_disk_cache configuration directives handlers.
*/
static const char
-*set_cache_root(cmd_parms *parms, void *struct_ptr, char *arg)
+*set_cache_root(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_size(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_size(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_gcint(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_gcint(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_dirlevels(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_dirlevels(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_dirlength(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_dirlength(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_exchk(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_exchk(cmd_parms *parms, void *in_struct_ptr, int flag)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_minfs(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_minfs(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_maxfs(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_maxfs(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_minetm(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_minetm(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_gctime(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_gctime(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*add_cache_gcclean(cmd_parms *parms, char *struct_ptr, char *arg)
+*add_cache_gcclean(cmd_parms *parms, void *in_struct_ptr, const char *arg, const char *arg1)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*add_cache_gcclnun(cmd_parms *parms, char *struct_ptr, char *arg)
+*add_cache_gcclnun(cmd_parms *parms, void *in_struct_ptr, const char *arg, const char *arg1)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);
return NULL;
}
static const char
-*set_cache_maxgcmem(cmd_parms *parms, char *struct_ptr, char *arg)
+*set_cache_maxgcmem(cmd_parms *parms, void *in_struct_ptr, const char *arg)
{
disk_cache_conf *conf = ap_get_module_config(parms->server->module_config,
&disk_cache_module);