2 * Copyright 2010 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _B_URL_SYNCHRONOUS_REQUEST_H_
6 #define _B_URL_SYNCHRONOUS_REQUEST_H_
9 #include <UrlRequest.h>
10 #include <UrlProtocolListener.h>
13 class BUrlSynchronousRequest
: public BUrlRequest
, public BUrlProtocolListener
{
15 BUrlSynchronousRequest(BUrlRequest
& asynchronousRequest
);
16 virtual ~BUrlSynchronousRequest() { };
19 virtual status_t
Perform();
20 virtual status_t
WaitUntilCompletion();
23 virtual void ConnectionOpened(BUrlRequest
* caller
);
24 virtual void HostnameResolved(BUrlRequest
* caller
,
26 virtual void ResponseStarted(BUrlRequest
* caller
);
27 virtual void HeadersReceived(BUrlRequest
* caller
,
28 const BUrlResult
& result
);
29 virtual void DataReceived(BUrlRequest
* caller
,
30 const char* data
, off_t position
,
32 virtual void DownloadProgress(BUrlRequest
* caller
,
33 ssize_t bytesReceived
, ssize_t bytesTotal
);
34 virtual void UploadProgress(BUrlRequest
* caller
,
35 ssize_t bytesSent
, ssize_t bytesTotal
);
36 virtual void RequestCompleted(BUrlRequest
* caller
,
41 bool fRequestComplete
;
42 BUrlRequest
& fWrappedRequest
;
46 #endif // _B_URL_SYNCHRONOUS_REQUEST_H_