diff --git a/src/ProtocolListener.h b/src/ProtocolListener.h index 4be0eda..d2e8384 100644 --- a/src/ProtocolListener.h +++ b/src/ProtocolListener.h @@ -9,6 +9,8 @@ #include +class BDataIO; + #ifndef LIBNETAPI_DEPRECATED using namespace BPrivate::Network; diff --git a/src/Util.cpp b/src/Util.cpp index e2e4a7c..b812ee4 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -139,9 +139,14 @@ fetch(BUrl url, BDataIO* reply, BString* hash, int timeout) ProtocolListener listener(true); boost::uuids::detail::sha1 sha1; + #ifdef LIBNETAPI_DEPRECATED BUrlRequest* request = BUrlProtocolRoster::MakeRequest(url, &listener); - listener.SetDownloadIO(reply); + #else + BUrlRequest* request = BUrlProtocolRoster::MakeRequest(url, reply, &listener); + listener.SetDownloadIO(NULL); + #endif + listener.SetSha1(&sha1); time_t startTime = time(0); diff --git a/src/Util.h b/src/Util.h index 2eea903..474cf49 100644 --- a/src/Util.h +++ b/src/Util.h @@ -7,6 +7,7 @@ #define UTIL_H #include +#include #include "ProtocolListener.h"