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

#include <libmythbase/http/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 
)
static

Definition at line 12 of file mythhttpranges.cpp.

Referenced by MythHTTPResponse::AddDefaultHeaders().

◆ BuildMultipartHeaders()

void MythHTTPRanges::BuildMultipartHeaders ( MythHTTPResponse Response)
static

Definition at line 36 of file mythhttpranges.cpp.

Referenced by MythHTTPResponse::AddContentHeaders().

◆ GetRangeHeader() [1/2]

QString MythHTTPRanges::GetRangeHeader ( HTTPRanges Ranges,
int64_t  Size 
)
static

◆ GetRangeHeader() [2/2]

QString MythHTTPRanges::GetRangeHeader ( HTTPRange Range,
int64_t  Size 
)
static

Definition at line 83 of file mythhttpranges.cpp.

◆ HandleRangeWrite()

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

Definition at line 97 of file mythhttpranges.cpp.

Referenced by MythHTTPSocket::Write().

◆ ParseRanges()

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

Parse a range request header.

Note
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).
Todo:
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 157 of file mythhttpranges.cpp.

Referenced by HandleRangeRequest().


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