[springlobby] 02/05: Imported Upstream version 0.247+dfsg
Markus Koschany
apo at moszumanska.debian.org
Sat May 14 23:24:30 UTC 2016
This is an automated email from the git hooks/post-receive script.
apo pushed a commit to branch master
in repository springlobby.
commit 9d460a8a5b2e345d54a495d6dd65a8ee88504939
Author: Markus Koschany <apo at debian.org>
Date: Sun May 15 00:32:50 2016 +0200
Imported Upstream version 0.247+dfsg
---
ChangeLog | 8 ++++++++
VERSION | 2 +-
springlobby_config.h | 2 +-
.../lib/src/Downloader/Http/HttpDownloader.cpp | 23 +++++++++++-----------
.../lib/src/Downloader/Rapid/RapidDownloader.cpp | 9 ++++++++-
src/downloader/lib/src/Downloader/Rapid/Sdp.cpp | 6 ++++++
src/downloader/lib/src/pr-downloader.cpp | 17 +++++++++++++---
src/downloader/prdownloader.cpp | 7 +++++++
src/gui/hosting/addbotdialog.cpp | 3 +++
src/gui/iconscollection.cpp | 10 +++++++---
src/gui/iconscollection.h | 2 +-
11 files changed, 67 insertions(+), 22 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5ebc102..d8d5b49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
ChangeLog of Springlobby
+## 0.247
+ - fix crash
+ - fix rapid tags downloaded twice
+
+## 0.246
+ - fix can't download more than one engine per session
+ - delete .sdp when rapid download failed
+
## 0.245
- fix crash on battle close
- fix springsettings always greyed out
diff --git a/VERSION b/VERSION
index 184d488..b5c7415 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.245
+0.247
diff --git a/springlobby_config.h b/springlobby_config.h
index 4f9bfb6..b3c893d 100644
--- a/springlobby_config.h
+++ b/springlobby_config.h
@@ -6,6 +6,6 @@
#undef VERSION
/* the git tag / commit we build from */
-#define VERSION "0.245"
+#define VERSION "0.247"
#endif /* SPRINGLOBBY_HEADERGUARD_CONFIG_H */
diff --git a/src/downloader/lib/src/Downloader/Http/HttpDownloader.cpp b/src/downloader/lib/src/Downloader/Http/HttpDownloader.cpp
index 0b7d935..fdde2fc 100644
--- a/src/downloader/lib/src/Downloader/Http/HttpDownloader.cpp
+++ b/src/downloader/lib/src/Downloader/Http/HttpDownloader.cpp
@@ -183,6 +183,7 @@ bool CHttpDownloader::ParseResult(const std::string& name, const std::string& js
}
res.push_back(dl);
}
+ LOG_DEBUG("Parsed %d results", res.size());
return true;
}
@@ -337,7 +338,7 @@ bool CHttpDownloader::setupDownload(DownloadData* piece)
CURL* curle = piece->curlw->GetHandle();
piece->mirror=piece->download->getFastestMirror();
if (piece->mirror==NULL) {
- LOG_ERROR("No mirror found");
+ LOG_ERROR("No mirror found for %s", piece->download->name.c_str());
return false;
}
@@ -368,9 +369,11 @@ bool CHttpDownloader::setupDownload(DownloadData* piece)
//this sets the header If-Modified-Since -> downloads only when remote file is newer than local file
const long timestamp = piece->download->file->GetTimestamp();
- curl_easy_setopt(curle, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
- curl_easy_setopt(curle, CURLOPT_TIMEVALUE, timestamp );
- curl_easy_setopt(curle, CURLOPT_FILETIME, 1);
+ if ((timestamp >= 0) && (piece->download->hash == nullptr)) { //timestamp known + hash not known -> only dl when changed
+ curl_easy_setopt(curle, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
+ curl_easy_setopt(curle, CURLOPT_TIMEVALUE, timestamp );
+ curl_easy_setopt(curle, CURLOPT_FILETIME, 1);
+ }
}
return true;
}
@@ -525,15 +528,11 @@ bool CHttpDownloader::download(std::list<IDownload*>& download, int max_parallel
DownloadData* dlData=new DownloadData();
dlData->download=dl;
if (!setupDownload(dlData)) { //no piece found (all pieces already downloaded), skip
- delete dlData;
- if (dl->state!=IDownload::STATE_FINISHED) {
- LOG_ERROR("no piece found");
- return false;
- }
- } else {
- downloads.push_back(dlData);
- curl_multi_add_handle(curlm, dlData->curlw->GetHandle());
+ LOG_ERROR("Failed to setup download %d/%d", i, count);
+ continue;
}
+ downloads.push_back(dlData);
+ curl_multi_add_handle(curlm, dlData->curlw->GetHandle());
}
}
if (downloads.empty()) {
diff --git a/src/downloader/lib/src/Downloader/Rapid/RapidDownloader.cpp b/src/downloader/lib/src/Downloader/Rapid/RapidDownloader.cpp
index 293d509..2deead1 100644
--- a/src/downloader/lib/src/Downloader/Rapid/RapidDownloader.cpp
+++ b/src/downloader/lib/src/Downloader/Rapid/RapidDownloader.cpp
@@ -13,6 +13,7 @@
#include <list>
#include <zlib.h>
#include <algorithm> //std::min
+#include <set>
#ifndef WIN32
#include <regex.h>
@@ -72,9 +73,15 @@ bool CRapidDownloader::download_name(IDownload* download, int reccounter, std::s
if (reccounter>10)
return false;
LOG_DEBUG("Using rapid to download %s", download->name.c_str());
+ std::set<std::string> downloaded;
+
for (CSdp& sdp: sdps) {
- if (!match_download_name(sdp.getName(), name.length() == 0 ? download->name : name ))
+ if (!match_download_name(sdp.getName(), name.empty() ? download->name : name ))
+ continue;
+
+ if (downloaded.find(sdp.getMD5()) != downloaded.end()) //already downloaded, skip (i.e. stable entries are twice in versions.gz)
continue;
+ downloaded.insert(sdp.getMD5());
LOG_DOWNLOAD(sdp.getName().c_str() );
if (!sdp.download(download)) {
diff --git a/src/downloader/lib/src/Downloader/Rapid/Sdp.cpp b/src/downloader/lib/src/Downloader/Rapid/Sdp.cpp
index 5469ef4..3dbf84d 100644
--- a/src/downloader/lib/src/Downloader/Rapid/Sdp.cpp
+++ b/src/downloader/lib/src/Downloader/Rapid/Sdp.cpp
@@ -113,6 +113,12 @@ bool CSdp::download(IDownload* download)
}
if (count>0) {
downloaded = downloadStream(this->url+"/streamer.cgi?"+this->md5,files);
+ if (!downloaded) {
+ LOG_ERROR("Couldn't download files for %s", this->md5.c_str());
+ fileSystem->removeFile(tmpFile);
+ fileSystem->removeFile(filename);
+ return false;
+ }
LOG_DEBUG("Sucessfully downloaded %d files: %s %s",count,shortname.c_str(),name.c_str());
} else {
LOG_DEBUG("Already downloaded: %s", shortname.c_str());
diff --git a/src/downloader/lib/src/pr-downloader.cpp b/src/downloader/lib/src/pr-downloader.cpp
index 7f4cc60..8076145 100644
--- a/src/downloader/lib/src/pr-downloader.cpp
+++ b/src/downloader/lib/src/pr-downloader.cpp
@@ -43,10 +43,21 @@ DownloadEnum::Category getPlatformEngineCat()
bool download_engine(std::list<IDownload*>& dllist)
{
- httpDownload->download(dllist);
bool res = true;
- for (const IDownload* dl: dllist) {
- if (isEngineDownload(dl->cat) && !fileSystem->extractEngine(dl->name, dl->version)) {
+ std::list<IDownload*> enginedls;
+
+
+ for (IDownload* dl: dllist) {
+ if (isEngineDownload(dl->cat)) {
+ enginedls.push_back(dl);
+ }
+ }
+ if (enginedls.empty())
+ return res;
+
+ httpDownload->download(enginedls);
+ for (const IDownload* dl: enginedls) {
+ if (!fileSystem->extractEngine(dl->name, dl->version)) {
LOG_ERROR("Failed to extract engine %s", dl->version.c_str());
res = false;
}
diff --git a/src/downloader/prdownloader.cpp b/src/downloader/prdownloader.cpp
index ea469b1..dac51bd 100644
--- a/src/downloader/prdownloader.cpp
+++ b/src/downloader/prdownloader.cpp
@@ -85,6 +85,7 @@ public:
const bool hasdlinfo = DownloadGetInfo(0, info);
//In case if something gone wrong
if (!hasdlinfo) {
+ wxLogWarning("Download has no downloadinfo!");
GlobalEventManager::Instance()->Send(GlobalEventManager::OnDownloadFailed);
return;
}
@@ -323,5 +324,11 @@ void PrDownloader::UpdateApplication(const std::string& updateurl)
bool PrDownloader::DownloadUrl(const std::string& httpurl, std::string& res)
{
+ {
+ boost::mutex::scoped_lock lock(dlProgressMutex);
+ if (m_progress == nullptr)
+ m_progress = new PrDownloader::DownloadProgress();
+ m_progress->name = httpurl;
+ }
return CHttpDownloader::DownloadUrl(httpurl, res);
}
diff --git a/src/gui/hosting/addbotdialog.cpp b/src/gui/hosting/addbotdialog.cpp
index bd38862..7b933d0 100644
--- a/src/gui/hosting/addbotdialog.cpp
+++ b/src/gui/hosting/addbotdialog.cpp
@@ -215,6 +215,9 @@ void AddBotDialog::OnClose(wxCommandEvent& /*event*/)
void AddBotDialog::OnAddBot(wxCommandEvent& /*event*/)
{
+ if (m_nick->GetValue().empty()) {
+ return;
+ }
sett().SetLastAI(m_ai->GetStringSelection());
EndModal(wxID_OK);
}
diff --git a/src/gui/iconscollection.cpp b/src/gui/iconscollection.cpp
index d997ded..4790fa0 100644
--- a/src/gui/iconscollection.cpp
+++ b/src/gui/iconscollection.cpp
@@ -228,10 +228,10 @@ wxBitmap& IconsCollection::GetColourBmp(const LSL::lslColor& colour)
}
}
-wxBitmap& IconsCollection::GetFractionBmp(const std::string& gameName, int fractionId)
+wxBitmap& IconsCollection::GetFractionBmp(const std::string& gameName, size_t fractionId)
{
- if (gameName.empty() || !LSL::usync().GameExists(gameName) || fractionId < 0) {
+ if (gameName.empty() || !LSL::usync().GameExists(gameName)) {
wxLogWarning("SideIcon %d for game %s not found!", fractionId, gameName.c_str());
// game doesn't exist, dl needed?!
return BMP_EMPTY;
@@ -244,7 +244,11 @@ wxBitmap& IconsCollection::GetFractionBmp(const std::string& gameName, int fract
wxLogWarning("IconsCollection::GetFractionBmp(): sides.empty()");
return BMP_EMPTY;
}
- ASSERT_LOGIC(fractionId < static_cast<int>(sides.size()), "LSL::usync().GetSides() < fractionID!");
+
+ if (fractionId >= sides.size()) {
+ wxLogWarning("Invalid side requested: %s:%d", gameName.c_str(), fractionId);
+ return BMP_EMPTY;
+ }
std::string sideName;
diff --git a/src/gui/iconscollection.h b/src/gui/iconscollection.h
index 761e321..7b988ea 100644
--- a/src/gui/iconscollection.h
+++ b/src/gui/iconscollection.h
@@ -111,7 +111,7 @@ public:
wxBitmap& GetFlagBmp(const wxString& country);
wxBitmap& GetRankBmp(unsigned int rank, bool showLowest = true);
wxBitmap& GetColourBmp(const LSL::lslColor& colour);
- wxBitmap& GetFractionBmp(const std::string& modName, int fractionId);
+ wxBitmap& GetFractionBmp(const std::string& modName, size_t fractionId);
wxBitmap& GetUserBattleStateBmp(const UserStatus& us);
wxBitmap& GetUserListStateBmp(const UserStatus& us, bool chanop, bool inbroom);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/springlobby.git
More information about the Pkg-games-commits
mailing list