You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
52 lines
1.5 KiB
#ifndef __PROTOCOL_HTTP_STREAM_HEADER__
|
|
#define __PROTOCOL_HTTP_STREAM_HEADER__
|
|
|
|
#include "../../components/base/basicSettingsProvider.h"
|
|
#include "../../components/base/basicTransport.h"
|
|
#include "../../data/curl/curlRequestsManager.h"
|
|
#include "../../data/net/clientPort.h"
|
|
#include "protocol.h"
|
|
|
|
#define HTTP_PROTOCOL_CONTENT_SETTINGS "CURL_POST_CONTENT_TYPE"
|
|
|
|
/**
|
|
* TODO: Add class description
|
|
*
|
|
* @author gagua
|
|
*/
|
|
class protocolHTTP /*: public protocolParser */
|
|
{
|
|
protected:
|
|
|
|
basicLogCollection * m_pLog;
|
|
curlRequestsManager * m_pHttpAccessManager;
|
|
CSTR m_pCurlPostType;
|
|
config_setting_t * m_pSettings;
|
|
|
|
// clientPort *m_oDataTransport;
|
|
|
|
// int packetChecker(unsigned char *Buffer, size_t BufferSize);
|
|
// protocolPackage *packetExtractor(unsigned char *Buffer, size_t BufferSize);
|
|
virtual bool packetHandler(protocolPackage * Package)
|
|
{
|
|
if (!Package)return false;
|
|
return false;
|
|
}
|
|
|
|
public:
|
|
|
|
// Constructor
|
|
protocolHTTP();
|
|
explicit protocolHTTP(config_setting_t * Settings);
|
|
// ToDo: change Serial to BaseClass of some kind of socket
|
|
// protocolHTTP( clientPort *SocketTransport, config_setting_t *Settings = NULL );
|
|
// Destructor
|
|
virtual ~protocolHTTP();
|
|
bool loadSettings(config_setting_t * Settings);
|
|
bool issueGet(CSTR URL);
|
|
bool issuePost(CSTR URL, char * Buffer, int & BufferSize);
|
|
/*virtual bool init(){ return true; };*/
|
|
static void * requestFinished(void *, void *);
|
|
};
|
|
|
|
#endif
|