FrcaCacheUnloadFile Subroutine

Purpose

Removes a cache entry from a cache that is associated with a Fast Response Cache Accelerator (FRCA) instance.

Library

FRCA Library (libfrca.a)

Syntax

#include <frca.h>
int32_t FrcaCacheUnoadFile ( CacheHandle,  FrcaHandle,  FileSpec);
int32_t  CacheHandle;
int32_t  FrcaHandle;
frca_filespec_t * FileSpec;

Description

The FrcaCacheUnoadFile subroutine removes a cache entry from an existing cache instance for an previously configured FRCA instance.

Parameters

Item Description
CacheHandle Identifies the cache instance from which the entry should be removed.
FrcaHandle Identifies the FRCA instance to which the cache instance belongs.
FileSpec Points to a frca_loadfile_t structure, which specifies characteristics used to identify the cache entry that is to be removed from the given cache. The structure contains the following members:

uint32_t  cacheEntryType;
char * fileName;
char * virtualHost;
char * searchKey;

Note: Structure members do not necessarily appear in this order.
cacheEntryType
Specifies the type of the cache entry. This field must be set to FCTRL_CET_HTTPFILE.
fileName
Specifies the absolute path to the file that is to be removed from the cache.
virtualHost
Specifies a virtual host name that is being served by the FRCA instance.
searchKey
Specifies the key under which the cache entry can be found.
Note: The FrcaCacheUnoadFile subroutine succeeds if a cache entry with the same type, file name, virtual host, and search key does not exist. This subroutine fails if the file associated with fileName does not exist or if the calling process does not have sufficient access permissions.

Return Values

Item Description
0 The subroutine completed successfully.
-1 The subroutine failed. The global variable errno is set to indicate the specific type of error.

Error Codes

Item Description
EINVAL The FileSpec parameter is zero or the cacheEntryType component is not set to FCTRL_CET_HTTPFILE or the searchKey component is zero or the fileName is '/' or the fileName is not an absolute path.
EFAULT The FileSpec parameter or one of the components points to an invalid address.
EACCES Access permission is denied on the fileName.