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

class HTTPWebdavHandler : public HTTPMethodHandler {
private:
    ws_message_t message;

    bool needDataForHeader;
    ulong64 dataSize;
    transfer_info_t transferInfo;
    bool needSendHeader;

    bool debugResultChanged;

    void PreparHeader();        // For protocol version 0 and 1
    void PreparHeaderV2();      // For protocol verison >= 2

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

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