Browse Source

don't be fooled by a <host> entry in an old contents.xml file

David Rose 15 years ago
parent
commit
ba6b73fab9
2 changed files with 5 additions and 0 deletions
  1. 4 0
      direct/src/plugin_npapi/ppInstance.cxx
  2. 1 0
      direct/src/plugin_npapi/ppInstance.h

+ 4 - 0
direct/src/plugin_npapi/ppInstance.cxx

@@ -184,6 +184,7 @@ begin() {
     url += '/';
     url += '/';
   }
   }
   _download_url_prefix = url;
   _download_url_prefix = url;
+  _standard_url_prefix = url;
   nout << "Plugin is built with " << PANDA_PACKAGE_HOST_URL << "\n";
   nout << "Plugin is built with " << PANDA_PACKAGE_HOST_URL << "\n";
 
 
   if (!is_plugin_loaded() && !_failed) {
   if (!is_plugin_loaded() && !_failed) {
@@ -202,6 +203,7 @@ begin() {
 
 
     if (!success) {
     if (!success) {
       // Go download the latest contents.xml file.
       // Go download the latest contents.xml file.
+      _download_url_prefix = _standard_url_prefix;
       ostringstream strm;
       ostringstream strm;
       strm << _download_url_prefix << "contents.xml";
       strm << _download_url_prefix << "contents.xml";
       
       
@@ -1168,6 +1170,8 @@ start_download(const string &url, PPDownloadRequest *req) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool PPInstance::
 bool PPInstance::
 read_contents_file(const string &contents_filename, bool fresh_download) {
 read_contents_file(const string &contents_filename, bool fresh_download) {
+  _download_url_prefix = _standard_url_prefix;
+
   TiXmlDocument doc(contents_filename.c_str());
   TiXmlDocument doc(contents_filename.c_str());
   if (!doc.LoadFile()) {
   if (!doc.LoadFile()) {
     return false;
     return false;

+ 1 - 0
direct/src/plugin_npapi/ppInstance.h

@@ -134,6 +134,7 @@ private:
   Tokens _tokens;
   Tokens _tokens;
 
 
   string _root_dir;
   string _root_dir;
+  string _standard_url_prefix;
   string _download_url_prefix;
   string _download_url_prefix;
   typedef vector<string> Mirrors;
   typedef vector<string> Mirrors;
   Mirrors _mirrors;
   Mirrors _mirrors;