Check whether the metadata files exists before passing them to Lasso.

git-svn-id: https://modmellon.googlecode.com/svn/trunk/mod_mellon2@92 a716ebb1-153a-0410-b759-cfb97c6a1b53
This commit is contained in:
olavmrk 2010-06-17 07:32:04 +00:00
parent 7f9dc4e7ce
commit 519fd01075
1 changed files with 12 additions and 0 deletions

View File

@ -97,12 +97,24 @@ static const char *am_set_filestring_slot(cmd_parms *cmd,
const char *arg)
{
const char *data;
apr_finfo_t finfo;
apr_status_t rv;
char error[64];
#ifdef HAVE_lasso_server_new_from_buffers
if ((data = am_getfile(cmd->pool, cmd->server, arg)) == NULL)
return apr_psprintf(cmd->pool, "%s - Cannot read file %s",
cmd->cmd->name, arg);
#else
rv = apr_stat(&finfo, arg, APR_FINFO_SIZE, cmd->pool);
if(rv != 0) {
apr_strerror(rv, error, sizeof(error));
return apr_psprintf(cmd->pool,
"%s - Cannot read file \"%s\" [%d] \"%s\"",
cmd->cmd->name, arg, rv, error);
}
data = arg;
#endif