gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10495: Fix encoding/decoding of DAT


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10495: Fix encoding/decoding of DATE AMF0 to include timezone (always 00, as documented).
Date: Tue, 30 Dec 2008 21:03:02 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10495
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Tue 2008-12-30 21:03:02 +0100
message:
  Fix encoding/decoding of DATE AMF0 to include timezone (always 00, as 
documented).
  Force use of GMT for SharedObjectTestRunner.sh, which is the only case in 
which
  pp *really* uses 00 as documented. Disable debugging enabled by last commits.
modified:
  libcore/as_value.cpp
  testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol
  testsuite/misc-ming.all/SharedObjectTestRunner.sh
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp      2008-12-30 19:08:52 +0000
+++ b/libcore/as_value.cpp      2008-12-30 20:03:02 +0000
@@ -59,10 +59,10 @@
 //#define GNASH_DEBUG_SOFT_REFERENCES
 
 // Define this macto to make AMF parsing verbose
-#define GNASH_DEBUG_AMF_DESERIALIZE
+//#define GNASH_DEBUG_AMF_DESERIALIZE
 
 // Define this macto to make AMF writing verbose
-#define GNASH_DEBUG_AMF_SERIALIZE
+//#define GNASH_DEBUG_AMF_SERIALIZE
 
 namespace {
 
@@ -2368,6 +2368,14 @@
 #endif
             as_object* obj = init_date_instance(dub);
                        ret.set_as_object(obj);
+
+                       if (b + 2 > end) {
+                               log_error(_("AMF0 read: premature end of input 
reading timezone from Date type"));
+                               return false;
+                       }
+            LOG_ONCE(log_unimpl("Timezone info from AMF0 encoded Date object 
ignored"));
+            b+=2;
+
                        return true;
         }
 
@@ -2463,8 +2471,14 @@
                                 "with index %d and value %g"), idx, d);
 #endif
                     buf.appendByte(amf::Element::DATE_AMF0);
+
                     amf::swapBytes(&d, 8); // this actually only swapps on 
little-endian machines
                     buf.append(&d, 8);
+
+                    // This should be timezone
+                    boost::uint16_t tz=0; 
+                    buf.appendNetworkShort(tz);
+
                     return true;
                 }
                 else

=== modified file 'testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol'
Binary files a/testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol    
2008-12-30 19:08:52 +0000 and 
b/testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol   2008-12-30 20:03:02 
+0000 differ
=== modified file 'testsuite/misc-ming.all/SharedObjectTestRunner.sh'
--- a/testsuite/misc-ming.all/SharedObjectTestRunner.sh 2008-12-30 19:17:41 
+0000
+++ b/testsuite/misc-ming.all/SharedObjectTestRunner.sh 2008-12-30 20:03:02 
+0000
@@ -62,7 +62,7 @@
 sleep 1
 
 export GNASHRC=${TOP_BUILDDIR}/testsuite/gnashrc
-export TZ=GMT-1
+export TZ=GMT
 
 #####################################################
 ##
@@ -90,10 +90,10 @@
                continue
        fi
        if ! cmp ${INPUTSOLDIR}/${solname} ${SOLDIR}/${solname}; then
-               echo "XFAILED: ! cmp ${SOLDIR}/${solname} 
${INPUTSOLDIR}/${solname}"
+               echo "FAILED: ! cmp ${SOLDIR}/${solname} 
${INPUTSOLDIR}/${solname}"
                continue
        fi
-       echo "XPASSED: SharedObject ${solname} matches input"
+       echo "PASSED: SharedObject ${solname} matches input"
 done
 
 #####################################################


reply via email to

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