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

class HTTPPostHandler: public HTTPMethodHandler {
private:
    struct {
        bool started;
        word type;
        wsr_flags_t flags;
        ulong64 contentLength;
    } curTransfer;

    void SetResultMIMEType(wsr_type_t type);

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:
    HTTPPostHandler(UHTTPMethodHandler * const user, class HTTPRegisteredPath * reqPathObj, class HTTPDataSource * dataSource, ISocket * const remoteSocket, IInstanceLog * const log, connection_flags_t connFlags);
    virtual ~HTTPPostHandler();
};