Support new BUrlProtocolRoster::MakeRequest()

This commit is contained in:
Jaidyn Ann 2021-03-02 19:22:50 -06:00
parent bbdc2c2865
commit faccada3f0
3 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,8 @@
#include <UrlProtocolListener.h> #include <UrlProtocolListener.h>
class BDataIO;
#ifndef LIBNETAPI_DEPRECATED #ifndef LIBNETAPI_DEPRECATED
using namespace BPrivate::Network; using namespace BPrivate::Network;

View File

@ -139,9 +139,14 @@ fetch(BUrl url, BDataIO* reply, BString* hash, int timeout)
ProtocolListener listener(true); ProtocolListener listener(true);
boost::uuids::detail::sha1 sha1; boost::uuids::detail::sha1 sha1;
#ifdef LIBNETAPI_DEPRECATED
BUrlRequest* request = BUrlProtocolRoster::MakeRequest(url, &listener); BUrlRequest* request = BUrlProtocolRoster::MakeRequest(url, &listener);
listener.SetDownloadIO(reply); listener.SetDownloadIO(reply);
#else
BUrlRequest* request = BUrlProtocolRoster::MakeRequest(url, reply, &listener);
listener.SetDownloadIO(NULL);
#endif
listener.SetSha1(&sha1); listener.SetSha1(&sha1);
time_t startTime = time(0); time_t startTime = time(0);

View File

@ -7,6 +7,7 @@
#define UTIL_H #define UTIL_H
#include <DateTime.h> #include <DateTime.h>
#include <Entry.h>
#include "ProtocolListener.h" #include "ProtocolListener.h"