LMMS
Loading...
Searching...
No Matches
juce::WebInputStream::Pimpl Class Reference

Public Member Functions

 Pimpl (WebInputStream &ownerStream, const URL &urlToCopy, bool addParametersToBody)
 ~Pimpl ()
bool isError () const
bool isExhausted ()
int64 getPosition ()
int64 getTotalLength ()
int read (void *buffer, int bytesToRead)
bool setPosition (int64 wantedPos)
void withExtraHeaders (const String &extraHeaders)
void withCustomRequestCommand (const String &customRequestCommand)
void withConnectionTimeout (int timeoutInMs)
void withNumRedirectsToFollow (int maxRedirectsToFollow)
StringPairArray getRequestHeaders () const
StringPairArray getResponseHeaders () const
int getStatusCode () const
void cleanup ()
void cancel ()
bool setOptions ()
bool connect (WebInputStream::Listener *webInputListener)
void finish ()
void singleStep ()
int readOrSkip (void *buffer, int bytesToRead, bool skip)
size_t curlWriteCallback (char *ptr, size_t size, size_t nmemb)
size_t curlReadCallback (char *ptr, size_t size, size_t nmemb)
size_t curlHeaderCallback (char *ptr, size_t size, size_t nmemb)
 Pimpl (WebInputStream &pimplOwner, const URL &urlToCopy, bool addParametersToBody)
 ~Pimpl ()
void withExtraHeaders (const String &extraHeaders)
void withCustomRequestCommand (const String &customRequestCommand)
void withConnectionTimeout (int timeoutInMs)
void withNumRedirectsToFollow (int maxRedirectsToFollow)
int getStatusCode () const
StringPairArray getRequestHeaders () const
StringPairArray getResponseHeaders () const
bool connect (WebInputStream::Listener *listener)
void cancel ()
bool isError () const
bool isExhausted ()
int64 getPosition ()
int64 getTotalLength ()
int read (void *buffer, int bytesToRead)
bool setPosition (int64 wantedPos)
 Pimpl (WebInputStream &pimplOwner, const URL &urlToCopy, bool addParametersToBody)
 ~Pimpl ()
void withExtraHeaders (const String &extraHeaders)
void withCustomRequestCommand (const String &customRequestCommand)
void withConnectionTimeout (int timeoutInMs)
void withNumRedirectsToFollow (int maxRedirectsToFollow)
StringPairArray getRequestHeaders () const
StringPairArray getResponseHeaders () const
int getStatusCode () const
bool connect (WebInputStream::Listener *listener)
bool isError () const
bool isExhausted ()
int64 getPosition ()
int64 getTotalLength ()
int read (void *buffer, int bytesToRead)
void cancel ()
bool setPosition (int64 wantedPos)

Static Public Member Functions

static size_t StaticCurlWrite (char *ptr, size_t size, size_t nmemb, void *userdata)
static size_t StaticCurlRead (char *ptr, size_t size, size_t nmemb, void *userdata)
static size_t StaticCurlHeader (char *ptr, size_t size, size_t nmemb, void *userdata)

Public Attributes

WebInputStreamowner
const URL url
std::unique_ptr< CURLSymbolssymbols { CURLSymbols::create() }
CURLM * multi = nullptr
CURL * curl = nullptr
struct curl_slist * headerList = nullptr
int lastError = CURLE_OK
int timeOutMs = 0
int maxRedirects = 5
const bool addParametersToRequestBody
const bool hasBodyDataToSend
String httpRequest
int64 contentLength = -1
int64 streamPos = 0
MemoryBlock curlBuffer
MemoryBlock headersAndPostData
String responseHeaders
String requestHeaders
int statusCode = -1
bool finished = false
size_t skipBytes = 0
const MemoryBlockpostBuffer = nullptr
size_t postPosition = 0
WebInputStream::Listenerlistener = nullptr
CriticalSection cleanupLock

Private Member Functions

void closeSocket (bool resetLevelsOfRedirection=true)
int createConnection (WebInputStream::Listener *listener, int numRedirects)
String readResponse (uint32 timeOutTime)
void closeConnection ()
void createConnection (const String &address, WebInputStream::Listener *listener)
void openConnection (URL_COMPONENTS &uc, HINTERNET sessionHandle, const String &address, WebInputStream::Listener *listener)
void applyTimeout (HINTERNET sessionHandle, const DWORD option)
void sendHTTPRequest (INTERNET_BUFFERS &buffers, WebInputStream::Listener *listener)
void openHTTPConnection (URL_COMPONENTS &uc, const String &address, WebInputStream::Listener *listener)

Static Private Member Functions

static void writeValueIfNotPresent (MemoryOutputStream &dest, const String &headers, const String &key, const String &value)
static void writeHost (MemoryOutputStream &dest, const String &httpRequestCmd, const String &path, const String &host, int port)
static MemoryBlock createRequestHeader (const String &hostName, int hostPort, const String &proxyName, int proxyPort, const String &hostPath, const String &originalURL, const String &userHeaders, const MemoryBlock &postData, const String &httpRequestCmd)
static bool sendHeader (int socketHandle, const MemoryBlock &requestHeader, uint32 timeOutTime, WebInputStream &pimplOwner, WebInputStream::Listener *listener)
static bool decomposeURL (const String &url, String &host, String &path, int &port)
static String findHeaderItem (const StringArray &lines, const String &itemName)

Private Attributes

URL url
int socketHandle = -1
int levelsOfRedirection = 0
StringArray headerLines
String address
String headers
MemoryBlock postData
int64 position = 0
int numRedirectsToFollow = 5
String httpRequestCmd
int64 chunkEnd = 0
bool isChunked = false
bool readingChunk = false
CriticalSection closeSocketLock
CriticalSection createSocketLock
bool hasBeenCancelled = false
HINTERNET connection = nullptr
HINTERNET request = nullptr
StringPairArray responseHeaders
CriticalSection createConnectionLock

Constructor & Destructor Documentation

◆ Pimpl() [1/3]

juce::WebInputStream::Pimpl::Pimpl ( WebInputStream & ownerStream,
const URL & urlToCopy,
bool addParametersToBody )
inline

◆ ~Pimpl() [1/3]

juce::WebInputStream::Pimpl::~Pimpl ( )
inline

◆ Pimpl() [2/3]

juce::WebInputStream::Pimpl::Pimpl ( WebInputStream & pimplOwner,
const URL & urlToCopy,
bool addParametersToBody )
inline

◆ ~Pimpl() [2/3]

juce::WebInputStream::Pimpl::~Pimpl ( )
inline

◆ Pimpl() [3/3]

juce::WebInputStream::Pimpl::Pimpl ( WebInputStream & pimplOwner,
const URL & urlToCopy,
bool addParametersToBody )
inline

◆ ~Pimpl() [3/3]

juce::WebInputStream::Pimpl::~Pimpl ( )
inline

Member Function Documentation

◆ applyTimeout()

void juce::WebInputStream::Pimpl::applyTimeout ( HINTERNET sessionHandle,
const DWORD option )
inlineprivate

◆ cancel() [1/3]

void juce::WebInputStream::Pimpl::cancel ( )
inline

◆ cancel() [2/3]

void juce::WebInputStream::Pimpl::cancel ( )
inline

◆ cancel() [3/3]

void juce::WebInputStream::Pimpl::cancel ( )
inline

◆ cleanup()

void juce::WebInputStream::Pimpl::cleanup ( )
inline

◆ closeConnection()

void juce::WebInputStream::Pimpl::closeConnection ( )
inlineprivate

◆ closeSocket()

void juce::WebInputStream::Pimpl::closeSocket ( bool resetLevelsOfRedirection = true)
inlineprivate

◆ connect() [1/3]

bool juce::WebInputStream::Pimpl::connect ( WebInputStream::Listener * listener)
inline

◆ connect() [2/3]

bool juce::WebInputStream::Pimpl::connect ( WebInputStream::Listener * listener)
inline

◆ connect() [3/3]

bool juce::WebInputStream::Pimpl::connect ( WebInputStream::Listener * webInputListener)
inline

◆ createConnection() [1/2]

void juce::WebInputStream::Pimpl::createConnection ( const String & address,
WebInputStream::Listener * listener )
inlineprivate

◆ createConnection() [2/2]

int juce::WebInputStream::Pimpl::createConnection ( WebInputStream::Listener * listener,
int numRedirects )
inlineprivate

◆ createRequestHeader()

MemoryBlock juce::WebInputStream::Pimpl::createRequestHeader ( const String & hostName,
int hostPort,
const String & proxyName,
int proxyPort,
const String & hostPath,
const String & originalURL,
const String & userHeaders,
const MemoryBlock & postData,
const String & httpRequestCmd )
inlinestaticprivate

◆ curlHeaderCallback()

size_t juce::WebInputStream::Pimpl::curlHeaderCallback ( char * ptr,
size_t size,
size_t nmemb )
inline

◆ curlReadCallback()

size_t juce::WebInputStream::Pimpl::curlReadCallback ( char * ptr,
size_t size,
size_t nmemb )
inline

◆ curlWriteCallback()

size_t juce::WebInputStream::Pimpl::curlWriteCallback ( char * ptr,
size_t size,
size_t nmemb )
inline

◆ decomposeURL()

bool juce::WebInputStream::Pimpl::decomposeURL ( const String & url,
String & host,
String & path,
int & port )
inlinestaticprivate

◆ findHeaderItem()

String juce::WebInputStream::Pimpl::findHeaderItem ( const StringArray & lines,
const String & itemName )
inlinestaticprivate

◆ finish()

void juce::WebInputStream::Pimpl::finish ( )
inline

◆ getPosition() [1/3]

int64 juce::WebInputStream::Pimpl::getPosition ( )
inline

◆ getPosition() [2/3]

int64 juce::WebInputStream::Pimpl::getPosition ( )
inline

◆ getPosition() [3/3]

int64 juce::WebInputStream::Pimpl::getPosition ( )
inline

◆ getRequestHeaders() [1/3]

StringPairArray juce::WebInputStream::Pimpl::getRequestHeaders ( ) const
inline

◆ getRequestHeaders() [2/3]

StringPairArray juce::WebInputStream::Pimpl::getRequestHeaders ( ) const
inline

◆ getRequestHeaders() [3/3]

StringPairArray juce::WebInputStream::Pimpl::getRequestHeaders ( ) const
inline

◆ getResponseHeaders() [1/3]

StringPairArray juce::WebInputStream::Pimpl::getResponseHeaders ( ) const
inline

◆ getResponseHeaders() [2/3]

StringPairArray juce::WebInputStream::Pimpl::getResponseHeaders ( ) const
inline

◆ getResponseHeaders() [3/3]

StringPairArray juce::WebInputStream::Pimpl::getResponseHeaders ( ) const
inline

◆ getStatusCode() [1/3]

int juce::WebInputStream::Pimpl::getStatusCode ( ) const
inline

◆ getStatusCode() [2/3]

int juce::WebInputStream::Pimpl::getStatusCode ( ) const
inline

◆ getStatusCode() [3/3]

int juce::WebInputStream::Pimpl::getStatusCode ( ) const
inline

◆ getTotalLength() [1/3]

int64 juce::WebInputStream::Pimpl::getTotalLength ( )
inline

◆ getTotalLength() [2/3]

int64 juce::WebInputStream::Pimpl::getTotalLength ( )
inline

◆ getTotalLength() [3/3]

int64 juce::WebInputStream::Pimpl::getTotalLength ( )
inline

◆ isError() [1/3]

bool juce::WebInputStream::Pimpl::isError ( ) const
inline

◆ isError() [2/3]

bool juce::WebInputStream::Pimpl::isError ( ) const
inline

◆ isError() [3/3]

bool juce::WebInputStream::Pimpl::isError ( ) const
inline

◆ isExhausted() [1/3]

bool juce::WebInputStream::Pimpl::isExhausted ( )
inline

◆ isExhausted() [2/3]

bool juce::WebInputStream::Pimpl::isExhausted ( )
inline

◆ isExhausted() [3/3]

bool juce::WebInputStream::Pimpl::isExhausted ( )
inline

◆ openConnection()

void juce::WebInputStream::Pimpl::openConnection ( URL_COMPONENTS & uc,
HINTERNET sessionHandle,
const String & address,
WebInputStream::Listener * listener )
inlineprivate

◆ openHTTPConnection()

void juce::WebInputStream::Pimpl::openHTTPConnection ( URL_COMPONENTS & uc,
const String & address,
WebInputStream::Listener * listener )
inlineprivate

◆ read() [1/3]

int juce::WebInputStream::Pimpl::read ( void * buffer,
int bytesToRead )
inline

◆ read() [2/3]

int juce::WebInputStream::Pimpl::read ( void * buffer,
int bytesToRead )
inline

◆ read() [3/3]

int juce::WebInputStream::Pimpl::read ( void * buffer,
int bytesToRead )
inline

◆ readOrSkip()

int juce::WebInputStream::Pimpl::readOrSkip ( void * buffer,
int bytesToRead,
bool skip )
inline

◆ readResponse()

String juce::WebInputStream::Pimpl::readResponse ( uint32 timeOutTime)
inlineprivate

◆ sendHeader()

bool juce::WebInputStream::Pimpl::sendHeader ( int socketHandle,
const MemoryBlock & requestHeader,
uint32 timeOutTime,
WebInputStream & pimplOwner,
WebInputStream::Listener * listener )
inlinestaticprivate

◆ sendHTTPRequest()

void juce::WebInputStream::Pimpl::sendHTTPRequest ( INTERNET_BUFFERS & buffers,
WebInputStream::Listener * listener )
inlineprivate

◆ setOptions()

bool juce::WebInputStream::Pimpl::setOptions ( )
inline

◆ setPosition() [1/3]

bool juce::WebInputStream::Pimpl::setPosition ( int64 wantedPos)
inline

◆ setPosition() [2/3]

bool juce::WebInputStream::Pimpl::setPosition ( int64 wantedPos)
inline

◆ setPosition() [3/3]

bool juce::WebInputStream::Pimpl::setPosition ( int64 wantedPos)
inline

◆ singleStep()

void juce::WebInputStream::Pimpl::singleStep ( )
inline

◆ StaticCurlHeader()

size_t juce::WebInputStream::Pimpl::StaticCurlHeader ( char * ptr,
size_t size,
size_t nmemb,
void * userdata )
inlinestatic

◆ StaticCurlRead()

size_t juce::WebInputStream::Pimpl::StaticCurlRead ( char * ptr,
size_t size,
size_t nmemb,
void * userdata )
inlinestatic

◆ StaticCurlWrite()

size_t juce::WebInputStream::Pimpl::StaticCurlWrite ( char * ptr,
size_t size,
size_t nmemb,
void * userdata )
inlinestatic

◆ withConnectionTimeout() [1/3]

void juce::WebInputStream::Pimpl::withConnectionTimeout ( int timeoutInMs)
inline

◆ withConnectionTimeout() [2/3]

void juce::WebInputStream::Pimpl::withConnectionTimeout ( int timeoutInMs)
inline

◆ withConnectionTimeout() [3/3]

void juce::WebInputStream::Pimpl::withConnectionTimeout ( int timeoutInMs)
inline

◆ withCustomRequestCommand() [1/3]

void juce::WebInputStream::Pimpl::withCustomRequestCommand ( const String & customRequestCommand)
inline

◆ withCustomRequestCommand() [2/3]

void juce::WebInputStream::Pimpl::withCustomRequestCommand ( const String & customRequestCommand)
inline

◆ withCustomRequestCommand() [3/3]

void juce::WebInputStream::Pimpl::withCustomRequestCommand ( const String & customRequestCommand)
inline

◆ withExtraHeaders() [1/3]

void juce::WebInputStream::Pimpl::withExtraHeaders ( const String & extraHeaders)
inline

◆ withExtraHeaders() [2/3]

void juce::WebInputStream::Pimpl::withExtraHeaders ( const String & extraHeaders)
inline

◆ withExtraHeaders() [3/3]

void juce::WebInputStream::Pimpl::withExtraHeaders ( const String & extraHeaders)
inline

◆ withNumRedirectsToFollow() [1/3]

void juce::WebInputStream::Pimpl::withNumRedirectsToFollow ( int maxRedirectsToFollow)
inline

◆ withNumRedirectsToFollow() [2/3]

void juce::WebInputStream::Pimpl::withNumRedirectsToFollow ( int maxRedirectsToFollow)
inline

◆ withNumRedirectsToFollow() [3/3]

void juce::WebInputStream::Pimpl::withNumRedirectsToFollow ( int maxRedirectsToFollow)
inline

◆ writeHost()

void juce::WebInputStream::Pimpl::writeHost ( MemoryOutputStream & dest,
const String & httpRequestCmd,
const String & path,
const String & host,
int port )
inlinestaticprivate

◆ writeValueIfNotPresent()

void juce::WebInputStream::Pimpl::writeValueIfNotPresent ( MemoryOutputStream & dest,
const String & headers,
const String & key,
const String & value )
inlinestaticprivate

Member Data Documentation

◆ addParametersToRequestBody

const bool juce::WebInputStream::Pimpl::addParametersToRequestBody

◆ address

String juce::WebInputStream::Pimpl::address
private

◆ chunkEnd

int64 juce::WebInputStream::Pimpl::chunkEnd = 0
private

◆ cleanupLock

CriticalSection juce::WebInputStream::Pimpl::cleanupLock

◆ closeSocketLock

CriticalSection juce::WebInputStream::Pimpl::closeSocketLock
private

◆ connection

HINTERNET juce::WebInputStream::Pimpl::connection = nullptr
private

◆ contentLength

int64 juce::WebInputStream::Pimpl::contentLength = -1

◆ createConnectionLock

CriticalSection juce::WebInputStream::Pimpl::createConnectionLock
private

◆ createSocketLock

CriticalSection juce::WebInputStream::Pimpl::createSocketLock
private

◆ curl

CURL* juce::WebInputStream::Pimpl::curl = nullptr

◆ curlBuffer

MemoryBlock juce::WebInputStream::Pimpl::curlBuffer

◆ finished

bool juce::WebInputStream::Pimpl::finished = false

◆ hasBeenCancelled

bool juce::WebInputStream::Pimpl::hasBeenCancelled = false
private

◆ hasBodyDataToSend

const bool juce::WebInputStream::Pimpl::hasBodyDataToSend

◆ headerLines

StringArray juce::WebInputStream::Pimpl::headerLines
private

◆ headerList

struct curl_slist* juce::WebInputStream::Pimpl::headerList = nullptr

◆ headers

String juce::WebInputStream::Pimpl::headers
private

◆ headersAndPostData

MemoryBlock juce::WebInputStream::Pimpl::headersAndPostData

◆ httpRequest

String juce::WebInputStream::Pimpl::httpRequest

◆ httpRequestCmd

String juce::WebInputStream::Pimpl::httpRequestCmd
private

◆ isChunked

bool juce::WebInputStream::Pimpl::isChunked = false
private

◆ lastError

int juce::WebInputStream::Pimpl::lastError = CURLE_OK

◆ levelsOfRedirection

int juce::WebInputStream::Pimpl::levelsOfRedirection = 0
private

◆ listener

WebInputStream::Listener* juce::WebInputStream::Pimpl::listener = nullptr

◆ maxRedirects

int juce::WebInputStream::Pimpl::maxRedirects = 5

◆ multi

CURLM* juce::WebInputStream::Pimpl::multi = nullptr

◆ numRedirectsToFollow

int juce::WebInputStream::Pimpl::numRedirectsToFollow = 5
private

◆ owner

WebInputStream & juce::WebInputStream::Pimpl::owner

◆ position

int64 juce::WebInputStream::Pimpl::position = 0
private

◆ postBuffer

const MemoryBlock* juce::WebInputStream::Pimpl::postBuffer = nullptr

◆ postData

MemoryBlock juce::WebInputStream::Pimpl::postData
private

◆ postPosition

size_t juce::WebInputStream::Pimpl::postPosition = 0

◆ readingChunk

bool juce::WebInputStream::Pimpl::readingChunk = false
private

◆ request

HINTERNET juce::WebInputStream::Pimpl::request = nullptr
private

◆ requestHeaders

String juce::WebInputStream::Pimpl::requestHeaders

◆ responseHeaders [1/2]

String juce::WebInputStream::Pimpl::responseHeaders

◆ responseHeaders [2/2]

StringPairArray juce::WebInputStream::Pimpl::responseHeaders
private

◆ skipBytes

size_t juce::WebInputStream::Pimpl::skipBytes = 0

◆ socketHandle

int juce::WebInputStream::Pimpl::socketHandle = -1
private

◆ statusCode

int juce::WebInputStream::Pimpl::statusCode = -1

◆ streamPos

int64 juce::WebInputStream::Pimpl::streamPos = 0

◆ symbols

std::unique_ptr<CURLSymbols> juce::WebInputStream::Pimpl::symbols { CURLSymbols::create() }

◆ timeOutMs

int juce::WebInputStream::Pimpl::timeOutMs = 0

◆ url [1/2]

const URL juce::WebInputStream::Pimpl::url

◆ url [2/2]

URL juce::WebInputStream::Pimpl::url
private

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