
/*---------------------------------------------------------------------------*/
/* http_get_handler.h                                                        */
/* copyright (c) innovaphone 2016                                            */
/*                                                                           */
/*---------------------------------------------------------------------------*/

class HTTPGetHandler: public HTTPMethodHandler {
private:
    fragmented_type_t fragmentedState;

    struct {
        bool started;
        word type;
        wsr_flags_t flags;
        ulong64 completeSize;
        char * etag;
        ulong64 streamedData;
        byte rangeType;
        ulong64 rangeStart;
        ulong64 rangeEnd;
    } curTransfer;

protected:
    virtual void OnPrepareHeader() override;
    virtual void OnSendMetaData(dword info, ExtendedHeader & extHeader) override;
    virtual http_method_init_t OnHandlerInit(const HTTPParser * parser, byte * buffer, size_t size) override;

public:
    HTTPGetHandler(UHTTPMethodHandler * const user, class HTTPRegisteredPath * reqPathObj, class HTTPDataSource * dataSource, ISocket * const remoteSocket, IInstanceLog * const log, connection_flags_t connFlags);
    virtual ~HTTPGetHandler();
};
