Refactor UrlRequest/UrlProtocol in the Service Kit

* Remove the BUrlRequest class, which was only delegating work to
BUrlProtocol and subclasses
 * Rename BUrlProtocol to BUrlRequest, and BUrlRequestHttp to BHttpRequest
 * Creating a request is now done through the BUrlProtocolRoster. For
now there is just a static MakeRequest method, this will be completed
when we get to actually allowing add-ons to provide different request
handlers.

This allows cleanup of the API for requests:
 * Remove the universal SetOption method with constants, and have
dedicated setters for each protocol option.
 * Setters can now have multiple parameters, for example you can give
BHTTPRequest a BDataIO and a known size
 * In this case, the BHttpRequest will not use HTTP chunked transfers,
which were always used before and made most servers unhappy (tested and
failed with lighttpd, google accounts and github).
This commit is contained in:
Adrien Destugues
2013-10-08 11:42:05 +02:00
parent 65e2db9f84
commit afd547b368
21 changed files with 596 additions and 843 deletions
+1 -2
View File
@@ -60,8 +60,7 @@ public:
// Change behavior
status_t MarkAsFile(const BString& filename,
const BString& mimeType);
status_t MarkAsFile(const BString& filename);
const BString& mimeType = "");
void UnmarkAsFile();
status_t CopyBuffer();