MythTV  master
Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
MythHTTPRequest Class Reference

Limited parsing of HTTP method and some headers to determine validity of request. More...

#include <libmythbase/http/mythhttprequest.h>

Collaboration diagram for MythHTTPRequest:
[legend]

Public Member Functions

 MythHTTPRequest (const MythHTTPConfig &Config, QString Method, HTTPHeaders Headers, HTTPData Content, QTcpSocket *Socket=nullptr)
 

Public Attributes

QString m_serverName
 
QString m_method
 
HTTPHeaders m_headers { nullptr }
 
HTTPData m_content { nullptr }
 
MythHTTPStatus m_status { HTTPBadRequest }
 
QUrl m_url
 
QString m_root
 
QString m_path
 
QString m_fileName
 
HTTPQueries m_queries
 
MythHTTPVersion m_version { HTTPUnknownVersion }
 
MythHTTPRequestType m_type { HTTPUnknown }
 
MythHTTPConnection m_connection { HTTPConnectionClose }
 
std::chrono::milliseconds m_timeout { HTTP_SOCKET_TIMEOUT_MS }
 
int m_allowed { HTTP_DEFAULT_ALLOWED }
 

Static Private Member Functions

static HTTPQueries ParseQuery (const QString &Query)
 

Detailed Description

Limited parsing of HTTP method and some headers to determine validity of request.

The aim here is to parse the minimum amount of data to determine whether the request should be processed and, if not, set enough state to send the appropriate error response.

Note
If parsing fails early, the connection type remains at 'close' and hence the socket will be closed once the error response is sent.

Definition at line 12 of file mythhttprequest.h.

Constructor & Destructor Documentation

◆ MythHTTPRequest()

MythHTTPRequest::MythHTTPRequest ( const MythHTTPConfig Config,
QString  Method,
HTTPHeaders  Headers,
HTTPData  Content,
QTcpSocket *  Socket = nullptr 
)

Definition at line 24 of file mythhttprequest.cpp.

Member Function Documentation

◆ ParseQuery()

HTTPQueries MythHTTPRequest::ParseQuery ( const QString &  Query)
staticprivate

Definition at line 148 of file mythhttprequest.cpp.

Referenced by MythHTTPRequest().

Member Data Documentation

◆ m_serverName

QString MythHTTPRequest::m_serverName

Definition at line 18 of file mythhttprequest.h.

◆ m_method

QString MythHTTPRequest::m_method

Definition at line 19 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_headers

HTTPHeaders MythHTTPRequest::m_headers { nullptr }

Definition at line 20 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_content

HTTPData MythHTTPRequest::m_content { nullptr }

Definition at line 21 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_status

MythHTTPStatus MythHTTPRequest::m_status { HTTPBadRequest }

Definition at line 23 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_url

QUrl MythHTTPRequest::m_url

Definition at line 24 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_root

QString MythHTTPRequest::m_root

Definition at line 25 of file mythhttprequest.h.

◆ m_path

QString MythHTTPRequest::m_path

Definition at line 26 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_fileName

QString MythHTTPRequest::m_fileName

Definition at line 27 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_queries

HTTPQueries MythHTTPRequest::m_queries

Definition at line 28 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_version

MythHTTPVersion MythHTTPRequest::m_version { HTTPUnknownVersion }

Definition at line 29 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_type

MythHTTPRequestType MythHTTPRequest::m_type { HTTPUnknown }

Definition at line 30 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_connection

MythHTTPConnection MythHTTPRequest::m_connection { HTTPConnectionClose }

Definition at line 31 of file mythhttprequest.h.

Referenced by MythHTTPRequest().

◆ m_timeout

std::chrono::milliseconds MythHTTPRequest::m_timeout { HTTP_SOCKET_TIMEOUT_MS }

Definition at line 32 of file mythhttprequest.h.

◆ m_allowed

int MythHTTPRequest::m_allowed { HTTP_DEFAULT_ALLOWED }

Definition at line 33 of file mythhttprequest.h.


The documentation for this class was generated from the following files: