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

@@ -0,0 +1,40 @@
/****************************************************************************
* This file is part of the project AqHome.
* AqHome (c) by 2023 Martin Preuss, all rights reserved.
*
* The license for this file can be found in the file COPYING which you
* should have received along with this file.
****************************************************************************/
#ifndef AQH_HTTP_SERVICE_HTTP_H
#define AQH_HTTP_SERVICE_HTTP_H
#include "aqhome/service/service.h"
#include <gwenhywfar/endpoint.h>
#include <gwenhywfar/msg.h>
#include <gwenhywfar/url.h>
#define AQH_HTTP_SERVICE_SESSIONCOOKIE "sessionid"
AQHOME_API GWEN_MSG *AQH_HttpService_HandleHttpRequest(AQH_SERVICE *sv, GWEN_MSG_ENDPOINT *endpoint, const GWEN_MSG *msgReceived);
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);
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 int AQH_HttpService_AddFile(AQH_SERVICE *sv, AQH_SESSION *session, const char *fname, GWEN_BUFFER *buf);
#endif