Network kit: use off_t for download and upload size

This change only applies in libnetservices.a. The implementation in
libbnetapi.so will use the original definitions.

Change-Id: I0aaa5a40af5fbcafaf233c32206cb4af862f8141
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2465
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
X512 2020-04-08 10:10:40 +09:00 committed by Niels Sascha Reedijk
parent 9984ca59f6
commit 626466daa4
4 changed files with 22 additions and 4 deletions

View File

@ -54,10 +54,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
virtual void RequestCompleted(BUrlRequest* caller,
bool success);
virtual void DebugMessage(BUrlRequest* caller,

View File

@ -44,10 +44,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
virtual void RequestCompleted(BUrlRequest* caller,
bool success);
virtual void DebugMessage(BUrlRequest* caller,

View File

@ -69,12 +69,12 @@ public:
fDownloadIO->Write(data, size);
}
virtual void DownloadProgress(BUrlRequest* caller, ssize_t bytesReceived,
virtual void DownloadProgress(BUrlRequest* caller, off_t bytesReceived,
ssize_t bytesTotal)
{
}
virtual void UploadProgress(BUrlRequest* caller, ssize_t bytesSent,
virtual void UploadProgress(BUrlRequest* caller, off_t bytesSent,
ssize_t bytesTotal)
{
}

View File

@ -31,9 +31,9 @@ public:
const char* data, off_t position,
ssize_t size);
void DownloadProgress(BUrlRequest* caller,
ssize_t bytesReceived, ssize_t bytesTotal);
off_t bytesReceived, ssize_t bytesTotal);
void UploadProgress(BUrlRequest* caller,
ssize_t bytesSent, ssize_t bytesTotal);
off_t bytesSent, ssize_t bytesTotal);
void RequestCompleted(BUrlRequest* caller,
bool success);
void DebugMessage(BUrlRequest* caller,