gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libbase/rc.cpp testsuite/libbas...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog libbase/rc.cpp testsuite/libbas...
Date: Fri, 28 Sep 2007 08:46:49 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   07/09/28 08:46:49

Modified files:
        .              : ChangeLog 
        libbase        : rc.cpp 
        testsuite/libbase: gnashrc.in 

Log message:
                * libbase/rc.cpp: for whitelists and blacklists, 'set' overrides
                  lists from previous files, 'append' adds to previous files.
                * testsuite/libbase/gnashrc.in: update tests, replace colons 
(old
                  behaviour) with spaces (new behaviour) in lists. Please update
                  your own lists, as old behaviour must eventually disappear.
        
        Docs and tests coming up...

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4458&r2=1.4459
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.35&r2=1.36
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/libbase/gnashrc.in?cvsroot=gnash&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4458
retrieving revision 1.4459
diff -u -b -r1.4458 -r1.4459
--- ChangeLog   28 Sep 2007 06:52:41 -0000      1.4458
+++ ChangeLog   28 Sep 2007 08:46:48 -0000      1.4459
@@ -1,3 +1,11 @@
+2007-09-27 Benjamin Wolsey <address@hidden>
+
+       * libbase/rc.cpp: for whitelists and blacklists, 'set' overrides
+         lists from previous files, 'append' adds to previous files.
+       * testsuite/libbase/gnashrc.in: update tests, replace colons (old
+         behaviour) with spaces (new behaviour) in lists. Please update
+         your own lists, as old behaviour must eventually disappear.
+
 2007-09-28 Sandro Santilli <address@hidden>
 
        * testsuite/actionscript.all/toString_valueOf.as: few more tests

Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- libbase/rc.cpp      25 Sep 2007 14:17:20 -0000      1.35
+++ libbase/rc.cpp      28 Sep 2007 08:46:49 -0000      1.36
@@ -270,49 +270,35 @@
         
         // Read in each line and parse it
         while (!in.eof()) {
+
+           // Make sure action is empty, otherwise the last loop (with no new
+           // data) keeps action, variable and value from the previous loop. 
This
+           // causes problems if set blacklist or set whitelist are last, 
because
+           // value is erased while parsing and the lists are thus deleted.
+           action.clear();
+
             // Get the first token
             in >> action;
+
             // Ignore comment lines
             if (action[0] == '#') {
-//        log_msg ("Ignoring comment line");
                 // suck up the rest of the line
                 char name[128];
                 in.getline(name, 128);
                 continue;
             }
             
+           // Get second token
             in >> variable;
+
+           // Read in rest of line for parsing.
             getline(in, value);
+
+           // Erase leading spaces.
             string::size_type position = value.find_first_not_of(' ');
             if(position != string::npos) value.erase(0, position);
 
-            //      log_msg ("%s %s %s", action, variable, value);
-            
-            if (action == "set") {
-                extractSetting(&_splash_screen, "splash_screen", variable,
-                               value);
-                extractSetting(&_localhost_only, "localhost", variable,
-                               value);
-                extractSetting(&_localdomain_only, "localdomain", variable,
-                               value);
-                extractSetting(&_debugger, "debugger", variable, value);
-                extractSetting(&_actiondump, "actionDump", variable, value);
-                extractSetting(&_parserdump, "parserDump", variable, value);
-                extractSetting(&_writelog, "writelog", variable, value);
-                extractSetting(&_sound, "sound", variable, value);
-                extractSetting(&_plugin_sound, "pluginsound", variable, value);
-                extractSetting(&_verboseASCodingErrors,
-                               "ASCodingErrorsVerbosity", variable, value);
-                extractSetting(&_verboseMalformedSWF, "MalformedSWFVerbosity",
-                               variable, value);
-                extractSetting(&_extensionsEnabled, "EnableExtensions",
-                               variable, value);
-                extractSetting(&_startStopped, "StartStopped", variable, 
value);
-
-                extractDouble(_streamsTimeout, "StreamsTimeout", variable, 
value);
-                
-                extractNumber(&_delay, "delay", variable, value);
-                extractNumber(&_verbosity, "verbosity", variable, value);
+            if (action == "set" || action == "append") {
 
                 if (variable == "flashVersionString") {
                     _flashVersionString = value;
@@ -330,6 +316,10 @@
                 }
                 
                 if (variable == "blacklist") {
+                   // 'set' should override all previous blacklists
+                   // else 'append' should add to the end.
+                   if (action == "set") _blacklist.clear();
+
                     string::size_type pos;
                     //This is an ugly way to avoid breaking lists
                     //Lists will work if they worked before, but
@@ -349,6 +339,8 @@
                 }
 
                 if (variable == "whitelist") {
+                   if (action == "set") _whitelist.clear();
+                   
                     string::size_type pos;
                     //This is an ugly way to avoid breaking lists
                     //Lists will work if they worked before, but
@@ -366,8 +358,36 @@
                     }
                     continue;
                 }
+
+               if (action == "set") {
+                     extractSetting(&_splash_screen, "splash_screen", variable,
+                               value);
+                     extractSetting(&_localhost_only, "localhost", variable,
+                               value);
+                     extractSetting(&_localdomain_only, "localdomain", 
variable,
+                               value);
+                     extractSetting(&_debugger, "debugger", variable, value);
+                     extractSetting(&_actiondump, "actionDump", variable, 
value);
+                     extractSetting(&_parserdump, "parserDump", variable, 
value);
+                     extractSetting(&_writelog, "writelog", variable, value);
+                     extractSetting(&_sound, "sound", variable, value);
+                     extractSetting(&_plugin_sound, "pluginsound", variable, 
value);
+                     extractSetting(&_verboseASCodingErrors,
+                               "ASCodingErrorsVerbosity", variable, value);
+                     extractSetting(&_verboseMalformedSWF, 
"MalformedSWFVerbosity",
+                               variable, value);
+                     extractSetting(&_extensionsEnabled, "EnableExtensions",
+                               variable, value);
+                     extractSetting(&_startStopped, "StartStopped", variable, 
value);
+
+                     extractDouble(_streamsTimeout, "StreamsTimeout", 
variable, value);
+                
+                     extractNumber(&_delay, "delay", variable, value);
+                     extractNumber(&_verbosity, "verbosity", variable, value);
             }
         }
+        }
+
     } else {
         if (in) {
             in.close();
@@ -379,7 +399,6 @@
         in.close();
     }
     
-    
     return true;
 }
 

Index: testsuite/libbase/gnashrc.in
===================================================================
RCS file: /sources/gnash/gnash/testsuite/libbase/gnashrc.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- testsuite/libbase/gnashrc.in        25 Sep 2007 14:17:21 -0000      1.8
+++ testsuite/libbase/gnashrc.in        28 Sep 2007 08:46:49 -0000      1.9
@@ -8,10 +8,7 @@
 set localhost on
 
 # These sites are OK
-set whitelist www.doonesbury.com:www.cnn.com:www.9news.com
-
-# Don't access content from these sites
-set blacklist www.doubleclick.com:www.ebay.com
+set whitelist www.doonesbury.com www.cnn.com www.9news.com
 
 # The delay between timer interupts
 set delay 50
@@ -54,3 +51,9 @@
 # of inactivity. Every activity resets the timer
 #
 set streamsTimeout 1.5
+
+# Don't access content from these sites
+# A blacklist or whitelist should be the last line in the file,
+# since these are the only values that can cause problems due to
+# the parser looping too many times.
+set blacklist www.doubleclick.com www.ebay.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]