
/*---------------------------------------------------------------------------*/
/* http_data_consumer.h                                                      */
/* copyright (c) innovaphone 2023                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

class HTTPDummyPathObject : public HTTPRegisteredPath {
private:
	
public:
	HTTPDummyPathObject();
	virtual ~HTTPDummyPathObject() {}
};


class HTTPDataConsumer : public HTTPDataSource, public UIoExec {
private:
	HTTPDummyPathObject pathObject;
	class HTTPMethodHandler * methodHandler = nullptr;
	
	virtual void IoExec(void * execContext) override;

public:
    HTTPDataConsumer(class Webserver * const webserver);
    virtual ~HTTPDataConsumer();

	virtual void RemoveConnectionUsingDataSource(class HTTPConnection * connection) override;
	virtual HTTPRegisteredPath * GetPathObject(const char * requestedPath, const char * reqPathEnd) override { return &this->pathObject; }
	virtual void SendMessage(const char * name, dword connectionID, ws_message_t message, dword gp = 0, const byte * buffer = nullptr, size_t bufSize = 0) override;
};
