addd urlhandler for static content, more reusing of code.
This commit is contained in:
@@ -63,7 +63,6 @@ static int _checkSession(const AQH_SESSION *session);
|
||||
static int _checkModule(const AQH_MODULE *m, int ignoreMissingId);
|
||||
static int _checkRoleList(const AQH_ROLE_LIST *roleList, int ignoreMissingId);
|
||||
static int _writeDbFile(const char *fname, GWEN_DB_NODE *db);
|
||||
static GWEN_STRINGLIST *_getConfFileList(const char *folder, const char *mask);
|
||||
static AQH_SESSION_LIST *_readAllSessionsIntoList(const AQH_SERVICE *sv);
|
||||
static AQH_SESSION *_readSessionFromFile(const char *filename);
|
||||
|
||||
@@ -761,6 +760,31 @@ int AQH_HttpService_DelSession(AQH_SERVICE *sv, AQH_SESSION *session)
|
||||
|
||||
|
||||
|
||||
GWEN_STRINGLIST *AQH_HttpService_GetFolderFileList(const char *folder, const char *mask, int senseCase)
|
||||
{
|
||||
GWEN_STRINGLIST *sl;
|
||||
int rv;
|
||||
|
||||
sl=GWEN_StringList_new();
|
||||
GWEN_StringList_SetSenseCase(sl, senseCase);
|
||||
|
||||
rv=GWEN_Directory_GetFileEntries(folder, sl, mask);
|
||||
if (rv<0) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "here (%d)", rv);
|
||||
GWEN_StringList_free(sl);
|
||||
return NULL;
|
||||
}
|
||||
if (GWEN_StringList_Count(sl)<1) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "Empty string list");
|
||||
GWEN_StringList_free(sl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
AQH_MODULE *_ensureModule(AQH_SERVICE *sv, const char *modName)
|
||||
{
|
||||
AQH_MODULE *module;
|
||||
@@ -1159,29 +1183,6 @@ GWEN_BUFFER *_getSessionFolder(const AQH_SERVICE *sv)
|
||||
|
||||
|
||||
|
||||
GWEN_STRINGLIST *_getConfFileList(const char *folder, const char *mask)
|
||||
{
|
||||
GWEN_STRINGLIST *sl;
|
||||
int rv;
|
||||
|
||||
sl=GWEN_StringList_new();
|
||||
rv=GWEN_Directory_GetFileEntries(folder, sl, mask);
|
||||
if (rv<0) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "here (%d)", rv);
|
||||
GWEN_StringList_free(sl);
|
||||
return NULL;
|
||||
}
|
||||
if (GWEN_StringList_Count(sl)<1) {
|
||||
DBG_INFO(AQH_LOGDOMAIN, "Empty string list");
|
||||
GWEN_StringList_free(sl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
AQH_SESSION_LIST *_readAllSessionsIntoList(const AQH_SERVICE *sv)
|
||||
{
|
||||
GWEN_BUFFER *folderBuf;
|
||||
@@ -1190,7 +1191,7 @@ AQH_SESSION_LIST *_readAllSessionsIntoList(const AQH_SERVICE *sv)
|
||||
if (folderBuf) {
|
||||
GWEN_STRINGLIST *fileList;
|
||||
|
||||
fileList=_getConfFileList(GWEN_Buffer_GetStart(folderBuf), "*.conf");
|
||||
fileList=AQH_HttpService_GetFolderFileList(GWEN_Buffer_GetStart(folderBuf), "*.conf", 1);
|
||||
if (fileList) {
|
||||
AQH_SESSION_LIST *sessionList;
|
||||
uint32_t pos;
|
||||
|
||||
Reference in New Issue
Block a user