Network Kit: Prepare for HTTP range requests
* The DataReceived hook gets a position argument, making it possible for listeners to handle out-of-order data (from two range requests at different positions, for example) * Adjust HaikuDepot (only user of the API in our sources) * Add a copy constructor to HTTPRequest that copies the relevant parameters from an existing request. Makes it easy to repeat a request with a different range. Could be useful for restarting downloads, or paralellizing them. * Add SetRangeStart, SetRangeEnd calls to HTTPRequest, no implementation yet. I'm putting all the API changes in this commit as it needs to be synced with a matching haikuwebkit release. * All archs must update to HaikuWebkit 1.3.0. Previous versions are broken by this.
This commit is contained in:
@@ -26,6 +26,7 @@ public:
|
||||
const char *protocolName = "HTTP",
|
||||
BUrlProtocolListener* listener = NULL,
|
||||
BUrlContext* context = NULL);
|
||||
BHttpRequest(const BHttpRequest& other);
|
||||
virtual ~BHttpRequest();
|
||||
|
||||
void SetMethod(const char* const method);
|
||||
@@ -38,6 +39,8 @@ public:
|
||||
void SetAutoReferrer(bool enable);
|
||||
void SetUserName(const BString& name);
|
||||
void SetPassword(const BString& password);
|
||||
void SetRangeStart(off_t position);
|
||||
void SetRangeEnd(off_t position);
|
||||
|
||||
void SetPostFields(const BHttpForm& fields);
|
||||
void SetHeaders(const BHttpHeaders& headers);
|
||||
@@ -115,6 +118,8 @@ private:
|
||||
BHttpForm* fOptPostFields;
|
||||
BDataIO* fOptInputData;
|
||||
ssize_t fOptInputDataSize;
|
||||
off_t fOptRangeStart;
|
||||
off_t fOptRangeEnd;
|
||||
bool fOptSetCookies : 1;
|
||||
bool fOptFollowLocation : 1;
|
||||
bool fOptDiscardData : 1;
|
||||
|
||||
Reference in New Issue
Block a user