aqhome: more work on http service.

This commit is contained in:
Martin Preuss
2023-08-07 14:08:52 +02:00
parent 6269431467
commit 1efcd09f0c
20 changed files with 2375 additions and 227 deletions

View File

@@ -13,33 +13,45 @@
#include "aqhome/service/service.h"
#include "aqhome/http/httprequest.h"
#include <gwenhywfar/msg.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/buffer.h>
#include <gwenhywfar/msg.h>
#include <gwenhywfar/url.h>
#include <gwenhywfar/mutex.h>
void AQH_HttpService_Extend(AQH_SERVICE *sv);
typedef int (*AQH_HTTP_SERVICE_HANDLEREQUEST_FN)(AQH_SERVICE *sv, AQH_HTTP_REQUEST *request);
const char *AQH_HttpService_GetSourceFolder(const AQH_SERVICE *sv);
void AQH_HttpService_SetSourceFolder(AQH_SERVICE *sv, const char *s);
const char *AQH_HttpService_GetSiteHeader(const AQH_SERVICE *sv);
void AQH_HttpService_SetSiteHeader(AQH_SERVICE *sv, const char *s);
AQHOME_API void AQH_HttpService_Extend(AQH_SERVICE *sv);
const char *AQH_HttpService_GetSiteFooter(const AQH_SERVICE *sv);
void AQH_HttpService_SetSiteFooter(AQH_SERVICE *sv, const char *s);
AQHOME_API const char *AQH_HttpService_GetConfigFolder(const AQH_SERVICE *sv);
AQHOME_API void AQH_HttpService_SetConfigFolder(AQH_SERVICE *sv, const char *s);
int AQH_HttpService_AddFile(AQH_SERVICE *sv, const char *fname, GWEN_BUFFER *buf);
void AQH_HttpService_AddStatusLine(AQH_SERVICE *sv, int code, const char *msg, const char *proto, GWEN_BUFFER *buf);
void AQH_HttpService_AddHeader(AQH_SERVICE *sv, GWEN_DB_NODE *dbHeader, GWEN_BUFFER *buf);
AQHOME_API const char *AQH_HttpService_GetSourceFolder(const AQH_SERVICE *sv);
AQHOME_API void AQH_HttpService_SetSourceFolder(AQH_SERVICE *sv, const char *s);
int AQH_HttpService_ParsePostBody(AQH_SERVICE *sv, const GWEN_MSG *msgReceived, GWEN_DB_NODE *dbBody);
AQHOME_API const char *AQH_HttpService_GetSiteHeader(const AQH_SERVICE *sv);
AQHOME_API void AQH_HttpService_SetSiteHeader(AQH_SERVICE *sv, const char *s);
AQHOME_API const char *AQH_HttpService_GetSiteFooter(const AQH_SERVICE *sv);
AQHOME_API void AQH_HttpService_SetSiteFooter(AQH_SERVICE *sv, const char *s);
AQHOME_API uint32_t AQH_HttpService_GetNextModuleId(AQH_SERVICE *sv);
AQHOME_API uint32_t AQH_HttpService_GetNextUserId(AQH_SERVICE *sv);
AQHOME_API int AQH_HttpService_GetMaxSessionAgeInSecs(const AQH_SERVICE *sv);
AQHOME_API void AQH_HttpService_SetMaxSessionAgeInSecs(AQH_SERVICE *sv, int i);
AQHOME_API AQH_HTTP_SERVICE_HANDLEREQUEST_FN AQH_HttpService_SetHandleRequestFn(AQH_SERVICE *sv, AQH_HTTP_SERVICE_HANDLEREQUEST_FN fn);
#endif