From be151807222ffa5972256aa9a392e8a319eae5ee Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 2 Nov 2010 15:59:10 -0700 Subject: start of the downloader service. --- .../viewer_components/updater/llupdatedownloader.h | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 indra/viewer_components/updater/llupdatedownloader.h (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h new file mode 100644 index 0000000000..9dc5d789ce --- /dev/null +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -0,0 +1,73 @@ +/** + * @file llupdatedownloader.h + * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_UPDATE_DOWNLOADER_H +#define LL_UPDATE_DOWNLOADER_H + + +#include +#include +#include "lluri.h" + + +// +// An asynchronous download service for fetching updates. +// +class LLUpdateDownloader +{ +public: + class Client; + class Implementation; + + LLUpdateDownloader(Client & client); + + // Cancel any in progress download. + void cancel(void); + + // Start a new download. + void download(LLURI const & uri); + + // Returns true if a download is in progress. + bool isDownloading(void); + +private: + boost::shared_ptr mImplementation; +}; + + +// +// An interface to be implemented by clients initiating a update download. +// +class LLUpdateDownloader::Client { + + // The download has completed successfully. + void downloadComplete(void); + + // The download failed. + void downloadError(std::string const & message); +}; + + +#endif \ No newline at end of file -- cgit v1.2.3 From 7622ab9249506539894d0e33d4c2a8fd9fb3e3ac Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Thu, 4 Nov 2010 11:33:02 -0700 Subject: just barely working udate downloading service; missing little nicities like error checking and sill stuff like that. --- indra/viewer_components/updater/llupdatedownloader.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 9dc5d789ce..6118c4338e 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -27,6 +27,7 @@ #define LL_UPDATE_DOWNLOADER_H +#include #include #include #include "lluri.h" @@ -38,15 +39,19 @@ class LLUpdateDownloader { public: + class BusyError; class Client; class Implementation; LLUpdateDownloader(Client & client); - // Cancel any in progress download. + // Cancel any in progress download; a no op if none is in progress. void cancel(void); // Start a new download. + // + // This method will throw a BusyException instance if a download is already + // in progress. void download(LLURI const & uri); // Returns true if a download is in progress. @@ -61,12 +66,13 @@ private: // An interface to be implemented by clients initiating a update download. // class LLUpdateDownloader::Client { +public: // The download has completed successfully. - void downloadComplete(void); + virtual void downloadComplete(void) = 0; // The download failed. - void downloadError(std::string const & message); + virtual void downloadError(std::string const & message) = 0; }; -- cgit v1.2.3 From e45ba2957630f6319f8c633a409d78be56c264bd Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Thu, 4 Nov 2010 15:09:10 -0700 Subject: Fix for linux eol error. --- indra/viewer_components/updater/llupdatedownloader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 6118c4338e..395d19d6bf 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -76,4 +76,4 @@ public: }; -#endif \ No newline at end of file +#endif -- cgit v1.2.3 From 191e164a503b72c7feae0a46ad0422740b365556 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Thu, 4 Nov 2010 15:49:19 -0700 Subject: some better error handling. --- indra/viewer_components/updater/llupdatedownloader.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 6118c4338e..8754ea329c 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -27,7 +27,6 @@ #define LL_UPDATE_DOWNLOADER_H -#include #include #include #include "lluri.h" @@ -39,20 +38,20 @@ class LLUpdateDownloader { public: - class BusyError; class Client; class Implementation; + // Returns the path to the download marker file containing details of the + // latest download. + static std::string downloadMarkerPath(void); + LLUpdateDownloader(Client & client); // Cancel any in progress download; a no op if none is in progress. void cancel(void); // Start a new download. - // - // This method will throw a BusyException instance if a download is already - // in progress. - void download(LLURI const & uri); + void download(LLURI const & uri, std::string const & hash); // Returns true if a download is in progress. bool isDownloading(void); -- cgit v1.2.3 From 9d7cdc17e311ba5f1f62112e316c531b68f67046 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Fri, 5 Nov 2010 11:12:54 -0700 Subject: resume feature (untested). --- indra/viewer_components/updater/llupdatedownloader.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 8754ea329c..7bfb430879 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -56,6 +56,9 @@ public: // Returns true if a download is in progress. bool isDownloading(void); + // Resume a partial download. + void resume(void); + private: boost::shared_ptr mImplementation; }; @@ -68,7 +71,7 @@ class LLUpdateDownloader::Client { public: // The download has completed successfully. - virtual void downloadComplete(void) = 0; + virtual void downloadComplete(LLSD const & data) = 0; // The download failed. virtual void downloadError(std::string const & message) = 0; -- cgit v1.2.3 From 02c362b8ccad08f290ca99a738ca6ad1546c7df6 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Fri, 5 Nov 2010 15:56:33 -0700 Subject: implement download cancel (untested). --- indra/viewer_components/updater/llupdatedownloader.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index dc8ecc378a..491a638f9a 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -47,7 +47,8 @@ public: LLUpdateDownloader(Client & client); - // Cancel any in progress download; a no op if none is in progress. + // Cancel any in progress download; a no op if none is in progress. The + // client will not receive a complete or error callback. void cancel(void); // Start a new download. -- cgit v1.2.3 From b2e84d739b4f5c00b497e57e892fc10d78af8b76 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Wed, 10 Nov 2010 14:26:14 -0800 Subject: CHOP-151 Adding startup updater flow to drive update installation and resume. --- indra/viewer_components/updater/llupdatedownloader.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/viewer_components/updater/llupdatedownloader.h') diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index dc8ecc378a..fb628c99eb 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -71,6 +71,11 @@ class LLUpdateDownloader::Client { public: // The download has completed successfully. + // data is a map containing the following items: + // url - source (remote) location + // hash - the md5 sum that should match the installer file. + // path - destination (local) location + // size - the size of the installer in bytes virtual void downloadComplete(LLSD const & data) = 0; // The download failed. -- cgit v1.2.3