libktorrent  2.2.0
Classes | Signals | Public Member Functions | List of all members
bt::HttpConnection Class Reference

#include <httpconnection.h>

Inheritance diagram for bt::HttpConnection:
Inheritance graph
[legend]

Signals

void startReplyTimer (int timeout)
 
void stopConnectTimer ()
 
void stopReplyTimer ()
 

Public Member Functions

bool closed () const
 Has the connection been closed.
 
bool connected () const
 See if we are connected.
 
void connectFinished (bool succeeded) override
 
void connectTo (const QUrl &url)
 
void connectToProxy (const QString &proxy, Uint16 proxy_port)
 
void dataSent () override
 
bool get (const QString &host, const QString &path, const QString &query, bt::Uint64 start, bt::Uint64 len)
 
bool getData (QByteArray &data)
 
int getDownloadRate () const
 Get the current download rate.
 
const QString getStatusString () const
 Get the status string.
 
bool isRedirected () const
 Is this connection redirected.
 
bool ok () const
 Check if the connection is OK.
 
void onDataReady (Uint8 *buf, Uint32 size) override
 
bool ready () const
 Ready to do another request.
 
QUrl redirectedUrl () const
 Get the redirected url.
 
int responseCode () const
 Get the last http response code.
 
void setGroupIDs (Uint32 up, Uint32 down)
 

Detailed Description

Author
Joris Guisson

HTTP connection for webseeding. We do not use KIO here, because we want to be able to apply the maximum upload and download rate to webseeds;

Definition at line 41 of file httpconnection.h.

Member Function Documentation

◆ connectFinished()

void bt::HttpConnection::connectFinished ( bool  succeeded)
overridevirtual

Called when a StreamSocket gets connected.

Implements net::StreamSocketListener.

◆ connectTo()

void bt::HttpConnection::connectTo ( const QUrl &  url)

Connect to a webseed

Parameters
urlUrl of the webseeder

◆ connectToProxy()

void bt::HttpConnection::connectToProxy ( const QString &  proxy,
Uint16  proxy_port 
)

Connect to a proxy.

Parameters
proxyThe HTTP proxy to use (null means don't use any)
proxy_portThe port of the HTTP proxy

◆ dataSent()

void bt::HttpConnection::dataSent ( )
overridevirtual

Called when all data has been sent.

Implements net::StreamSocketListener.

◆ get()

bool bt::HttpConnection::get ( const QString &  host,
const QString &  path,
const QString &  query,
bt::Uint64  start,
bt::Uint64  len 
)

Do a HTTP GET request

Parameters
pathThe path of the file
queryThe query string for the url
startOffset into file
lenLength of data to download

◆ getData()

bool bt::HttpConnection::getData ( QByteArray &  data)

Get some part of the

Parameters
dataBytearray to copy the data into
Returns
true if data was filled in

◆ onDataReady()

void bt::HttpConnection::onDataReady ( Uint8 *  buf,
Uint32  size 
)
overridevirtual

Function which will be called whenever data has been read from the socket. This data should be dealt with, otherwise it will be discarded.

Parameters
bufThe buffer
sizeThe size of the buffer

Implements net::SocketReader.

◆ setGroupIDs()

void bt::HttpConnection::setGroupIDs ( Uint32  up,
Uint32  down 
)

Set the group ID's of the socket

Parameters
upUpload group id
downDownload group id

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