dmpapacheserverrequest.h 2.0 KB
#ifndef __dmpapacheserverrequest_h__
#define __dmpapacheserverrequest_h__

#include "dmpserverrequest.h"
#include <fcgi_stdio.h>
#include <string.h>
#include <iostream>


struct CgiENV
{
        
     std::string HTTP_HOST;
     std::string HTTP_CONNECTION;
     std::string HTTP_SEC_CH_UA;
     std::string HTTP_SEC_CH_UA_MOBILE;   
     std::string HTTP_SEC_CH_UA_PLATFORM;

     std::string HTTP_UPGRADE_INSECURE_REQUESTS;
     std::string HTTP_USER_AGENT;
     std::string HTTP_ACCEPT;
     std::string HTTP_SEC_FETCH_SITE;   
     std::string HTTP_SEC_FETCH_MODE;
     
     std::string HTTP_SEC_FETCH_USER;
     std::string HTTP_SEC_FETCH_DEST;
     std::string HTTP_ACCEPT_ENCODING;
     std::string HTTP_ACCEPT_LANGUAGE;
     std::string PATH;

     std::string SERVER_SIGNATURE;   
     std::string SERVER_SOFTWARE;
     std::string SERVER_NAME;   
     std::string SERVER_ADDR;
     std::string SERVER_PORT; 
     
     std::string REMOTE_ADDR;   
     std::string DOCUMENT_ROOT;
     std::string REQUEST_SCHEME;   
     std::string CONTEXT_PREFIX;
     std::string CONTEXT_DOCUMENT_ROOT;
     
     std::string SERVER_ADMIN;   
     std::string SCRIPT_FILENAME;
     std::string REMOTE_PORT;   
     std::string GATEWAY_INTERFACE;
     std::string SERVER_PROTOCOL;
     
     std::string REQUEST_METHOD;
     std::string QUERY_STRING;   
     std::string REQUEST_URI;
     std::string PATH_INFO;
     std::string SCRIPT_NAME;
     
     std::string PATH_TRANSLATED;
   
};
class SERVER_EXPORT DmpApacheServerRequest : public DmpServerRequest
{

public:
 
    DmpApacheServerRequest(FCGX_ParamArray& evnp,FCGX_Stream *in,FCGX_Stream*out,FCGX_Stream *err);
    DmpApacheServerRequest(CgiENV &env);

    const void * GetData() const override;
	int GetDataLength() const override;
    void SetContext(std::string &strdata);

private:
    const void* data_;
    int data_len_;
};

#endif //__dmapapacheserverrequest_h__