From faccada3f01406882be5891f3317d7365040fb78 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Tue, 2 Mar 2021 19:22:50 -0600 Subject: [PATCH] Support new BUrlProtocolRoster::MakeRequest() --- src/ProtocolListener.h | 2 ++ src/Util.cpp | 7 ++++++- src/Util.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) 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"