diff --git a/headers/private/netservices/UrlSynchronousRequest.h b/headers/private/netservices/UrlSynchronousRequest.h index 17dfe6780c..1a56b11d0c 100644 --- a/headers/private/netservices/UrlSynchronousRequest.h +++ b/headers/private/netservices/UrlSynchronousRequest.h @@ -35,10 +35,19 @@ public: virtual void DataReceived(BUrlRequest* caller, const char* data, off_t position, ssize_t size); + +#ifdef LIBNETAPI_DEPRECATED virtual void DownloadProgress(BUrlRequest* caller, ssize_t bytesReceived, ssize_t bytesTotal); virtual void UploadProgress(BUrlRequest* caller, ssize_t bytesSent, ssize_t bytesTotal); +#else + virtual void DownloadProgress(BUrlRequest* caller, + off_t bytesReceived, off_t bytesTotal); + virtual void UploadProgress(BUrlRequest* caller, + off_t bytesSent, off_t bytesTotal); +#endif //LIBNETAPI_DEPRECATED + virtual void RequestCompleted(BUrlRequest* caller, bool success); diff --git a/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp b/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp index 9e54771bbf..7fd279c9e6 100644 --- a/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp +++ b/src/kits/network/libnetservices/UrlProtocolDispatchingListener.cpp @@ -107,7 +107,7 @@ BUrlProtocolDispatchingListener::DataReceived(BUrlRequest* caller, #ifdef LIBNETAPI_DEPRECATED void BUrlProtocolDispatchingListener::DownloadProgress(BUrlRequest* caller, - size_t bytesReceived, size_t bytesTotal) + ssize_t bytesReceived, ssize_t bytesTotal) { BMessage message(B_URL_PROTOCOL_NOTIFICATION); message.AddInt32("url:bytesReceived", bytesReceived); @@ -119,7 +119,7 @@ BUrlProtocolDispatchingListener::DownloadProgress(BUrlRequest* caller, void BUrlProtocolDispatchingListener::UploadProgress(BUrlRequest* caller, - size_t bytesSent, size_t bytesTotal) + ssize_t bytesSent, ssize_t bytesTotal) { BMessage message(B_URL_PROTOCOL_NOTIFICATION); message.AddInt32("url:bytesSent", bytesSent); diff --git a/src/kits/network/libnetservices/UrlProtocolListener.cpp b/src/kits/network/libnetservices/UrlProtocolListener.cpp index 5ea32bcde8..fd953faa53 100644 --- a/src/kits/network/libnetservices/UrlProtocolListener.cpp +++ b/src/kits/network/libnetservices/UrlProtocolListener.cpp @@ -57,6 +57,7 @@ BUrlProtocolListener::DataReceived(BUrlRequest*, const char*, off_t, ssize_t) } +#ifdef LIBNETAPI_DEPRECATED void BUrlProtocolListener::DownloadProgress(BUrlRequest*, ssize_t, ssize_t) { @@ -68,6 +69,20 @@ BUrlProtocolListener::UploadProgress(BUrlRequest*, ssize_t, ssize_t) { } +#else + +void +BUrlProtocolListener::DownloadProgress(BUrlRequest*, off_t, off_t) +{ +} + + +void +BUrlProtocolListener::UploadProgress(BUrlRequest*, off_t, off_t) +{ +} +#endif // LIBNETAPI_DEPRECATED + void BUrlProtocolListener::RequestCompleted(BUrlRequest*, bool) diff --git a/src/kits/network/libnetservices/UrlSynchronousRequest.cpp b/src/kits/network/libnetservices/UrlSynchronousRequest.cpp index d822c6500b..3306e6454f 100644 --- a/src/kits/network/libnetservices/UrlSynchronousRequest.cpp +++ b/src/kits/network/libnetservices/UrlSynchronousRequest.cpp @@ -88,6 +88,7 @@ BUrlSynchronousRequest::DataReceived(BUrlRequest*, const char*, } +#ifdef LIBNETAPI_DEPRECATED void BUrlSynchronousRequest::DownloadProgress(BUrlRequest*, ssize_t bytesReceived, ssize_t bytesTotal) @@ -106,6 +107,28 @@ BUrlSynchronousRequest::UploadProgress(BUrlRequest*, ssize_t bytesSent, } +#else + + +void +BUrlSynchronousRequest::DownloadProgress(BUrlRequest*, + off_t bytesReceived, off_t bytesTotal) +{ + PRINT(("SynchronousRequest::DownloadProgress(%" B_PRIdOFF ", %" B_PRIdOFF + ")\n", bytesReceived, bytesTotal)); +} + + +void +BUrlSynchronousRequest::UploadProgress(BUrlRequest*, off_t bytesSent, + off_t bytesTotal) +{ + PRINT(("SynchronousRequest::UploadProgress(%" B_PRIdOFF ", %" B_PRIdOFF + ")\n", bytesSent, bytesTotal)); +} +#endif // LIBNETAPI_DEPRECATED + + void BUrlSynchronousRequest::RequestCompleted(BUrlRequest* caller, bool success) {