aqhome: more work on http server.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
|
||||
|
||||
#include "aqhome/service/service.h"
|
||||
#include "aqhome/http/httprequest.h"
|
||||
#include "aqhome/http/urlhandler.h"
|
||||
|
||||
#include <gwenhywfar/endpoint.h>
|
||||
#include <gwenhywfar/msg.h>
|
||||
@@ -22,6 +24,23 @@
|
||||
|
||||
AQHOME_API GWEN_MSG *AQH_HttpService_HandleHttpRequest(AQH_SERVICE *sv, GWEN_MSG_ENDPOINT *endpoint, const GWEN_MSG *msgReceived);
|
||||
|
||||
AQHOME_API void AQH_HttpService_AddUrlHandler(AQH_SERVICE *sv, AQH_HTTP_URLHANDLER *urlHandler);
|
||||
|
||||
|
||||
/**
|
||||
* Set modulname in request, get and set matching module and determine the calling users permissions in regard
|
||||
* to the selected module.
|
||||
*/
|
||||
AQHOME_API void AQH_HttpService_SetupModuleAndPerms(AQH_SERVICE *sv, AQH_HTTP_REQUEST *rq, const char *modulName);
|
||||
|
||||
|
||||
/**
|
||||
* Set permissions for this request according to session, user and module.
|
||||
*
|
||||
* The members session and module must have been set before calling this function.
|
||||
*/
|
||||
AQHOME_API void AQH_HttpService_SetRequestPerms(AQH_SERVICE *sv, AQH_HTTP_REQUEST *rq);
|
||||
|
||||
|
||||
AQHOME_API void AQH_HttpService_AddStatusLine(AQH_SERVICE *sv, int code, const char *msg, const char *proto, GWEN_BUFFER *buf);
|
||||
AQHOME_API void AQH_HttpService_AddHeader(AQH_SERVICE *sv, GWEN_DB_NODE *dbHeader, GWEN_BUFFER *buf);
|
||||
@@ -29,7 +48,12 @@ AQHOME_API void AQH_HttpService_AddHeader(AQH_SERVICE *sv, GWEN_DB_NODE *dbHeade
|
||||
AQHOME_API int AQH_HttpService_ParsePostBody(AQH_SERVICE *sv, const GWEN_MSG *msgReceived, GWEN_DB_NODE *dbBody);
|
||||
|
||||
|
||||
AQHOME_API GWEN_MSG *AQH_HttpService_CreateResponseMsg(AQH_SERVICE *sv, int code, const char *text, const char *protocol);
|
||||
AQHOME_API GWEN_MSG *AQH_HttpService_CreateResponseMsg(AQH_SERVICE *sv,
|
||||
int code, const char *text, const char *protocol,
|
||||
const char *page);
|
||||
|
||||
AQHOME_API GWEN_MSG *AQH_HttpService_CreateRedirectingResponseMsg(AQH_SERVICE *sv, const char *protocol, const char *newPage);
|
||||
|
||||
|
||||
AQHOME_API int AQH_HttpService_AddFile(AQH_SERVICE *sv, AQH_SESSION *session, const char *fname, GWEN_BUFFER *buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user