Bläddra i källkod

onpluginfail in more cases

David Rose 16 år sedan
förälder
incheckning
086e53a453

+ 7 - 2
direct/src/plugin_activex/PPInstance.cpp

@@ -417,7 +417,10 @@ int PPInstance::DownloadP3DComponents( std::string& p3dDllFilename )
         }
         }
       }
       }
     }
     }
-    
+
+    if (error) {
+      set_failed();
+    }
     return error;
     return error;
 }
 }
 
 
@@ -448,7 +451,6 @@ int PPInstance::LoadPlugin( const std::string& dllFilename )
       nout << "Attempting to load core API from " << pathname << "\n";
       nout << "Attempting to load core API from " << pathname << "\n";
       if (!load_plugin(pathname, "", "", true, "", "", "", false, false, nout)) {
       if (!load_plugin(pathname, "", "", true, "", "", "", false, false, nout)) {
         nout << "Unable to launch core API in " << pathname << "\n";
         nout << "Unable to launch core API in " << pathname << "\n";
-        set_failed();
         error = 1;
         error = 1;
       } else {
       } else {
 #ifdef PANDA_OFFICIAL_VERSION
 #ifdef PANDA_OFFICIAL_VERSION
@@ -464,6 +466,9 @@ int PPInstance::LoadPlugin( const std::string& dllFilename )
       }
       }
     }
     }
 
 
+    if (error) {
+      set_failed();
+    }
     return error ;
     return error ;
 }
 }
 
 

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

@@ -480,7 +480,7 @@ url_notify(const char *url, NPReason reason, void *notifyData) {
         string contents_filename = _root_dir + "/contents.xml";
         string contents_filename = _root_dir + "/contents.xml";
         if (!read_contents_file(contents_filename)) {
         if (!read_contents_file(contents_filename)) {
           nout << "Unable to read contents file " << contents_filename << "\n";
           nout << "Unable to read contents file " << contents_filename << "\n";
-          // TODO: fail
+          set_failed();
         }
         }
       }
       }
     }
     }
@@ -1107,7 +1107,7 @@ downloaded_file(PPDownloadRequest *req, const string &filename) {
       string contents_filename = _root_dir + "/contents.xml";
       string contents_filename = _root_dir + "/contents.xml";
       if (!read_contents_file(contents_filename)) {
       if (!read_contents_file(contents_filename)) {
         nout << "Unable to read contents file " << contents_filename << "\n";
         nout << "Unable to read contents file " << contents_filename << "\n";
-        // TODO: fail
+        set_failed();
       }
       }
     }
     }
     break;
     break;
@@ -1231,7 +1231,7 @@ downloaded_plugin(const string &filename) {
       return;
       return;
     }
     }
 
 
-    // TODO: fail
+    set_failed();
     return;
     return;
   }
   }
 
 
@@ -1239,12 +1239,13 @@ downloaded_plugin(const string &filename) {
   string pathname = _core_api_dll.get_pathname(_root_dir);
   string pathname = _core_api_dll.get_pathname(_root_dir);
   if (!copy_file(filename, pathname)) {
   if (!copy_file(filename, pathname)) {
     nout << "Couldn't copy " << pathname << "\n";
     nout << "Couldn't copy " << pathname << "\n";
+    set_failed();
     return;
     return;
   }
   }
 
 
   if (!_core_api_dll.quick_verify(_root_dir)) {
   if (!_core_api_dll.quick_verify(_root_dir)) {
     nout << "After copying, " << pathname << " is no good.\n";
     nout << "After copying, " << pathname << " is no good.\n";
-    // TODO: fail
+    set_failed();
     return;
     return;
   }
   }