MythTV  master
Static Public Member Functions | Static Protected Member Functions | List of all members
MythHTTPRanges Class Reference

#include <mythhttpranges.h>

Static Public Member Functions

static void HandleRangeRequest (MythHTTPResponse *Response, const QString &Request)
static void BuildMultipartHeaders (MythHTTPResponse *Response)
static QString GetRangeHeader (HTTPRanges &Ranges, int64_t Size)
static QString GetRangeHeader (HTTPRange &Range, int64_t Size)
static HTTPMulti HandleRangeWrite (HTTPVariant Data, int64_t Available, int64_t &ToWrite, int64_t &Offset)

Static Protected Member Functions

static MythHTTPStatus ParseRanges (const QString &Request, int64_t TotalSize, HTTPRanges &Ranges, int64_t &PartialSize)
 Parse a range request header. More...

Detailed Description

Definition at line 12 of file mythhttpranges.h.

Member Function Documentation

◆ HandleRangeRequest()

void MythHTTPRanges::HandleRangeRequest ( MythHTTPResponse Response,
const QString &  Request 

Definition at line 12 of file mythhttpranges.cpp.

Referenced by MythHTTPResponse::AddDefaultHeaders().

◆ BuildMultipartHeaders()

void MythHTTPRanges::BuildMultipartHeaders ( MythHTTPResponse Response)

Definition at line 32 of file mythhttpranges.cpp.

Referenced by MythHTTPResponse::AddContentHeaders().

◆ GetRangeHeader() [1/2]

QString MythHTTPRanges::GetRangeHeader ( HTTPRanges Ranges,
int64_t  Size 

◆ GetRangeHeader() [2/2]

QString MythHTTPRanges::GetRangeHeader ( HTTPRange Range,
int64_t  Size 

Definition at line 75 of file mythhttpranges.cpp.

◆ HandleRangeWrite()

HTTPMulti MythHTTPRanges::HandleRangeWrite ( HTTPVariant  Data,
int64_t  Available,
int64_t &  ToWrite,
int64_t &  Offset 

Definition at line 89 of file mythhttpranges.cpp.

Referenced by MythHTTPSocket::Write().

◆ ParseRanges()

MythHTTPStatus MythHTTPRanges::ParseRanges ( const QString &  Request,
int64_t  TotalSize,
HTTPRanges Ranges,
int64_t &  PartialSize 

Parse a range request header.

If we fail to parse the header, we return HTTP 200 and the range request is effectively ignored. We return HTTP 416 Requested Range Not Satisfiable where it is parsed but is invalid. If parsed and valid, we return HTTP 206 (Partial Content).
Per the specs, sending complicated range requests could potentially be used as part of a (D)DOS attack and it is suggested that various complicated requests are rejected. Probably unnecessary here.

Definition at line 149 of file mythhttpranges.cpp.

Referenced by HandleRangeRequest().

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