gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11364: merge from cygnal branch.


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11364: merge from cygnal branch.
Date: Tue, 04 Aug 2009 11:39:22 -0600
User-agent: Bazaar (1.16.1)

------------------------------------------------------------
revno: 11364 [merge]
committer: address@hidden
branch nick: trunk
timestamp: Tue 2009-08-04 11:39:22 -0600
message:
  merge from cygnal branch.
added:
  testsuite/network.all/SharedObject_as.hx
renamed:
  libcore/asobj/flash/net/NetConnection_as.h => 
libcore/asobj/flash/net/NetConnection_as.h.stub
modified:
  configure.ac
  extensions/dejagnu/Makefile.am
  libamf/sol.cpp
  libamf/sol.h
  libbase/extension.cpp
  libcore/asobj/flash/net/SharedObject_as.cpp
  libcore/asobj/flash/net/SharedObject_as.h
  libcore/asobj/flash/net/net.am
  libcore/namedStrings.cpp
  libcore/namedStrings.h
  libnet/Makefile.am
  libnet/http.cpp
  libnet/http.h
  libnet/network.h
  libnet/rtmp.cpp
  libnet/rtmp.h
  libnet/rtmp_client.cpp
  libnet/rtmp_client.h
  libnet/rtmp_msg.cpp
  libnet/rtmp_msg.h
  testsuite/network.all/Makefile.am
=== modified file 'configure.ac'
--- a/configure.ac      2009-07-24 20:42:41 +0000
+++ b/configure.ac      2009-08-04 17:39:22 +0000
@@ -463,13 +463,16 @@
 
 dnl Build the cgibins server if specified.
 AC_ARG_ENABLE(cgibins,
-  AC_HELP_STRING([--enable-cgibin], [Enable building of the CGIs for Cygnal]),
+  AC_HELP_STRING([--enable-cgibins], [Enable building of the CGIs for Cygnal]),
 [case "${enableval}" in
   yes) cgibin=yes ;;
   no)  cgibin=no ;;
-  *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibin option]) ;;
+  *)   AC_MSG_ERROR([bad value ${enableval} for enable-cgibins option]) ;;
 esac],cgibin=yes)
 AM_CONDITIONAL(USE_CGI, test x$cgibin = xyes)
+if test x"${cgibin}" = x"yes"; then
+  AC_DEFINE([USE_CGIBIN], [1], [Enable cgi-bin processes for Cygnal])
+fi
 
 dnl Fix the Intel 810 LOD bias problem
 AC_ARG_ENABLE(i810-lod-bias,

=== modified file 'extensions/dejagnu/Makefile.am'
--- a/extensions/dejagnu/Makefile.am    2009-05-13 15:46:50 +0000
+++ b/extensions/dejagnu/Makefile.am    2009-08-04 03:14:59 +0000
@@ -23,12 +23,12 @@
 plugins_LTLIBRARIES = dejagnu.la
 
 INCLUDES =  \
-            -I$(top_srcdir)/libbase \
-            -I$(top_srcdir)/libcore \
-            -I$(top_srcdir)/libcore/swf \
-            -I$(top_srcdir)/libcore/vm \
-           -I$(top_srcdir)/libcore/asobj \
-           $(INCLTDL)
+       -I$(top_srcdir)/libbase \
+        -I$(top_srcdir)/libcore \
+        -I$(top_srcdir)/libcore/swf \
+        -I$(top_srcdir)/libcore/vm \
+       -I$(top_srcdir)/libcore/asobj \
+       $(INCLTDL)
 
 AM_LDFLAGS =  \
        $(top_builddir)/libbase/libgnashbase.la \

=== modified file 'libamf/sol.cpp'
--- a/libamf/sol.cpp    2009-04-23 14:46:54 +0000
+++ b/libamf/sol.cpp    2009-08-04 03:12:19 +0000
@@ -461,6 +461,26 @@
     
 }
 
+bool 
+SOL::updateSO(boost::shared_ptr<amf::Element> &newel)
+{
+//    GNASH_REPORT_FUNCTION;
+    vector<boost::shared_ptr<amf::Element> >::iterator ita; 
+    for (ita = _amfobjs.begin(); ita != _amfobjs.end(); ita++) {
+        boost::shared_ptr<amf::Element> oldel = (*(ita));
+       if (oldel == newel) {
+           oldel = newel;
+       }
+   }
+}
+
+bool
+SOL::updateSO(int index, boost::shared_ptr<amf::Element> &el)
+{
+//    GNASH_REPORT_FUNCTION;
+    _amfobjs[index] = el;    
+}
+
 ///  \brief Dump the internal data of this class in a human readable form.
 ///
 /// @remarks This should only be used for debugging purposes.

=== modified file 'libamf/sol.h'
--- a/libamf/sol.h      2009-02-25 22:33:03 +0000
+++ b/libamf/sol.h      2009-08-04 03:12:19 +0000
@@ -179,6 +179,9 @@
     ///                in the .sol file.
     const std::string &getObjectName() const { return _objname; };
         
+    bool updateSO(boost::shared_ptr<amf::Element> &el);
+    bool updateSO(int index, boost::shared_ptr<amf::Element> &el);
+    
     ///  \brief Dump the internal data of this class in a human readable form.
     ///
     /// @remarks This should only be used for debugging purposes.
@@ -201,13 +204,15 @@
     ///                The full path and name of the .sol file.
     std::string      _filespec;
 
+    /// \var SOL::_filesize
+    ///                The size of the .sol file.
+    int              _filesize;
+
+ protected:
     /// \var SOL::_amfobjs
     ///                The array of elements in this SharedObject.
     std::vector<boost::shared_ptr<Element> > _amfobjs;
     
-    /// \var SOL::_filesize
-    ///                The size of the .sol file.
-    int              _filesize;
   };
 
  

=== modified file 'libbase/extension.cpp'
--- a/libbase/extension.cpp     2009-06-13 19:52:34 +0000
+++ b/libbase/extension.cpp     2009-08-04 03:13:58 +0000
@@ -152,8 +152,7 @@
         sl = new SharedLib(module);
         sl->openLib();
         _plugins[module] = sl;
-    }
-    else {
+    } else {
         sl = _plugins[module];
     }
     
@@ -163,8 +162,7 @@
 
     if (symptr) {    
         symptr(where);
-    }
-    else {
+    } else {
         log_error(_("Couldn't get class_init symbol"));
     }
     
@@ -183,8 +181,7 @@
         sl = new SharedLib(module);
         sl->openLib();
         _plugins[module] = sl;
-    }
-    else {
+    } else {
         sl = _plugins[module];
     }
 
@@ -192,8 +189,7 @@
 
     if (symptr) {
         symptr(obj);
-    }
-    else {
+    } else {
         log_error(_("Couldn't get class_init symbol: \"%s\""), func);
     }
 

=== renamed file 'libcore/asobj/flash/net/NetConnection_as.h' => 
'libcore/asobj/flash/net/NetConnection_as.h.stub'
=== modified file 'libcore/asobj/flash/net/SharedObject_as.cpp'
--- a/libcore/asobj/flash/net/SharedObject_as.cpp       2009-07-29 05:40:20 
+0000
+++ b/libcore/asobj/flash/net/SharedObject_as.cpp       2009-08-04 17:39:22 
+0000
@@ -21,11 +21,13 @@
 #include "gnashconfig.h" // USE_SOL_READ_ONLY
 #endif
 
+#include "smart_ptr.h" // GNASH_USE_GC
 #include "movie_root.h"
 #include "GnashSystemNetHeaders.h"
 #include "GnashFileUtilities.h" // stat
 #include "SimpleBuffer.h"
 #include "as_value.h"
+#include "action.h"
 #include "amf.h"
 #include "element.h"
 #include "sol.h"
@@ -34,7 +36,6 @@
 #include "log.h"
 #include "fn_call.h"
 #include "Global_as.h"
-#include "smart_ptr.h" // for boost intrusive_ptr
 #include "builtin_function.h" // need builtin_function
 #include "Object.h" // for getObjectInterface
 #include "VM.h"
@@ -44,7 +45,7 @@
 #include "URL.h"
 #include "rc.h" // for use of rcfile
 
-#include <boost/tokenizer.hpp>
+#include "NetConnection_as.h"
 #include <boost/scoped_array.hpp>
 #include <boost/shared_ptr.hpp>
 
@@ -57,6 +58,7 @@
 }
 
 using namespace amf;
+using namespace std;
 
 namespace gnash {
 
@@ -74,9 +76,10 @@
     as_value sharedobject_getDiskUsage(const fn_call& fn);
     as_value sharedobject_getRemote(const fn_call& fn);
     as_value sharedobject_data(const fn_call& fn);
-
     as_value sharedobject_getLocal(const fn_call& fn);
     as_value sharedobject_ctor(const fn_call& fn);
+    as_value sharedobject_setdirty(const fn_call& fn);
+    as_value sharedobject_setproperty(const fn_call& fn);
 
     as_object* readSOL(VM& vm, const std::string& filespec);
 
@@ -220,16 +223,16 @@
 
 } // anonymous namespace
 
-class SharedObject_as: public as_object 
+class SharedObject_as: public as_object
 {
 public:
 
     ~SharedObject_as();
 
     SharedObject_as()
-        :
-        as_object(getSharedObjectInterface()),
-        _data(0)
+        : as_object(getSharedObjectInterface()),
+          _data(0),
+          _persistance(0)
     { 
     }
 
@@ -278,15 +281,27 @@
         return _data;
     }
 
+    bool getPersistance() { return _persistance; };
+    void setPersistance(bool flag) { _persistance = flag; };
+
+    /// Process the close() method.
+    void close();
+
+    /// Process the connect(uri) method.
+    void connect(NetConnection_as *obj, const std::string& uri);
+
+    NetConnection_as *_netconn;
+
 protected:
 
-    void markReachableResources() const {
-        if (_data) _data->setReachable();
-    }
+#ifdef GNASH_USE_GC
+    void markReachableResources() const;
+#endif
 
 private:
 
-    as_object* _data;
+    as_object   *_data;
+    bool        _persistance;
 
     SOL _sol;
 };
@@ -403,11 +418,26 @@
     return true;
 }
 
+/// Process the close() method.
+void
+SharedObject_as::close()
+{
+}
+
+/// Process the connect(uri) method.
+void
+SharedObject_as::connect(NetConnection_as */* obj */, const std::string& /* 
uri */)
+{
+    GNASH_REPORT_FUNCTION;
+   
+}
 
 SharedObjectLibrary::SharedObjectLibrary(VM& vm)
     :
     _vm(vm)
 {
+    GNASH_REPORT_FUNCTION;
+
     _solSafeDir = rcfile.getSOLSafeDir();
     if (_solSafeDir.empty()) {
         log_debug("Empty SOLSafeDir directive: we'll use '/tmp'");
@@ -466,6 +496,15 @@
 
 }
 
+#ifdef GNASH_USE_GC
+void
+SharedObject_as::markReachableResources() const
+{
+    if (_data) _data->setReachable();
+}
+#endif // GNASH_USE_GC
+
+#ifdef GNASH_USE_GC
 void
 SharedObjectLibrary::markReachableResources() const
 {
@@ -476,6 +515,7 @@
         sh->setReachable();
     }
 }
+#endif
 
 /// The SharedObjectLibrary keeps all known SharedObjects alive. They must
 /// be flushed on clear(). This is called at the latest by the dtor, which
@@ -604,6 +644,65 @@
     return obj;
 }
 
+SharedObject_as*
+SharedObjectLibrary::getRemote(const std::string& objName,
+                               const std::string& uri,
+                               const std::string& persistance)
+{
+    GNASH_REPORT_FUNCTION;
+
+    assert (!objName.empty());
+
+    // Check that the name is valid; if not, return null
+    if (!validateName(objName)) {
+        return 0;
+    }
+
+    // The 'root' argument, otherwise known as localPath, specifies where
+    // in the SWF path the SOL should be stored. It cannot be outside this
+    // path.
+    std::string requestedPath;
+    std::ostringstream solPath;
+    URL url(uri);
+    
+    const std::string& key = url.path();
+
+    // If the shared object was already opened, use it.
+    SoLib::iterator it = _soLib.find(key);
+    if (it != _soLib.end()) {
+        log_debug("SharedObject %s already known, returning it", key);
+        return it->second;
+    } else {
+        log_debug("SharedObject %s not loaded. Loading it now", key);
+    }
+
+    // Otherwise create a new one and register to the lib
+    SharedObject_as* obj = new SharedObject_as;
+    _soLib[key] = obj;
+
+    obj->setObjectName(objName);
+
+    // Not persistance on either the client or the server
+    if (persistance == "false") {
+        obj->setPersistance(false);
+    }
+    // Persistance only on the server
+    if (persistance == "true") {
+        obj->setPersistance(true);
+    }
+    
+    boost::intrusive_ptr<as_object> data;
+    if (persistance[0] == '/') {
+        obj->setPersistance(true);
+        boost::intrusive_ptr<as_object> localdata = getLocal(objName, 
url.path());
+        if (localdata) {
+            obj->setData(localdata.get());
+        }
+    }
+
+    return obj;
+}
+
 void
 sharedobject_class_init(as_object& where, const ObjectURI& uri)
 {
@@ -627,13 +726,13 @@
     VM& vm = getVM(o);
 
     // ASnative table registration
-       vm.registerNative(sharedobject_connect, 2106, 0);
-       vm.registerNative(sharedobject_send, 2106, 1);
-       vm.registerNative(sharedobject_flush, 2106, 2);
-       vm.registerNative(sharedobject_close, 2106, 3);
-       vm.registerNative(sharedobject_getsize, 2106, 4);
-       vm.registerNative(sharedobject_setFps, 2106, 5);
-       vm.registerNative(sharedobject_clear, 2106, 6);
+    vm.registerNative(sharedobject_connect, 2106, 0);
+    vm.registerNative(sharedobject_send, 2106, 1);
+    vm.registerNative(sharedobject_flush, 2106, 2);
+    vm.registerNative(sharedobject_close, 2106, 3);
+    vm.registerNative(sharedobject_getsize, 2106, 4);
+    vm.registerNative(sharedobject_setFps, 2106, 5);
+    vm.registerNative(sharedobject_clear, 2106, 6);
 
     // FIXME: getRemote and getLocal use both these methods,
     // but aren't identical with either of them.
@@ -641,13 +740,15 @@
     // SharedObject or null. The second takes a new SharedObject as
     // its first argument and populates its data member (more or less
     // like readSOL). This is only important for ASNative compatibility.
-       vm.registerNative(sharedobject_getLocal, 2106, 202);
-       vm.registerNative(sharedobject_getRemote, 2106, 203);
-       vm.registerNative(sharedobject_getLocal, 2106, 204);
-       vm.registerNative(sharedobject_getRemote, 2106, 205);
-
-       vm.registerNative(sharedobject_deleteAll, 2106, 206);
-       vm.registerNative(sharedobject_getDiskUsage, 2106, 207);
+    vm.registerNative(sharedobject_getLocal, 2106, 202);
+    vm.registerNative(sharedobject_getRemote, 2106, 203);
+    vm.registerNative(sharedobject_getLocal, 2106, 204);
+    vm.registerNative(sharedobject_getRemote, 2106, 205);
+    
+    vm.registerNative(sharedobject_deleteAll, 2106, 206);
+    vm.registerNative(sharedobject_getDiskUsage, 2106, 207);
+    vm.registerNative(sharedobject_setdirty, 2106, 208);
+    vm.registerNative(sharedobject_setproperty, 2106, 209);
 }
 
 
@@ -672,6 +773,8 @@
     o.init_member("setFps", vm.getNative(2106, 5), flags);
     o.init_member("clear", vm.getNative(2106, 6), flags);
 
+    o.init_member("setDirty", vm.getNative(2106, 7), flags);
+    o.init_member("setProperty", vm.getNative(2106, 8), flags);
 }
 
 
@@ -721,13 +824,74 @@
 }
 
 as_value
+sharedobject_setdirty(const fn_call& fn)
+{
+    boost::intrusive_ptr<SharedObject_as> obj = 
+        ensureType<SharedObject_as>(fn.this_ptr);
+    UNUSED(obj);
+    
+    LOG_ONCE(log_unimpl (__FUNCTION__));
+
+    return as_value();
+}
+
+as_value
+sharedobject_setproperty(const fn_call& fn)
+{
+    GNASH_REPORT_FUNCTION;    
+    boost::intrusive_ptr<SharedObject_as> obj = 
+        ensureType<SharedObject_as>(fn.this_ptr);
+    UNUSED(obj);
+    
+    LOG_ONCE(log_unimpl (__FUNCTION__));
+
+    return as_value();
+}
+
+as_value
 sharedobject_connect(const fn_call& fn)
 {
+    GNASH_REPORT_FUNCTION;    
+
     boost::intrusive_ptr<SharedObject_as> obj =
         ensureType<SharedObject_as>(fn.this_ptr);
-    UNUSED(obj);
-
-    LOG_ONCE(log_unimpl("SharedObject.connect"));
+
+    if (fn.nargs < 1) {
+        IF_VERBOSE_ASCODING_ERRORS(
+            log_aserror(_("SharedObject.connect(): needs at least "
+                    "one argument"));
+        );
+        return as_value();
+    }
+
+    // Although the ActionScript spec says connect() takes two
+    // arguments, the HAXE implementation only supports one.
+    // So we have to make sure the NetCnnection object we get
+    // passed is already had the URI specified to connect to.
+    if (fn.nargs > 1) {
+       const as_value& uri = fn.arg(1);
+       const VM& vm = getVM(fn);
+       const std::string& uriStr = uri.to_string_versioned(vm.getSWFVersion());
+    }
+    
+    boost::intrusive_ptr<NetConnection_as> nc =
+       boost::dynamic_pointer_cast<NetConnection_as>(                          
                     fn.arg(0).to_object(*getGlobal(fn)));
+
+    // This is always set without validification.fooc->setURI(uriStr);
+
+    // Check first arg for validity 
+    if (getSWFVersion(fn) > 6) {
+        nc->connect();
+    } else {
+        if (fn.nargs > 0) {
+            std::stringstream ss; fn.dump_args(ss);
+            log_unimpl("SharedObject.connect(%s): args after the first are "
+                    "not supported", ss.str());
+        }
+//         nc->connect(uriStr);
+        nc->connect();
+    }
+    
     return as_value();
 }
 
@@ -736,9 +900,9 @@
 {
     boost::intrusive_ptr<SharedObject_as> obj =
         ensureType<SharedObject_as>(fn.this_ptr);
-    UNUSED(obj);
-
-    LOG_ONCE(log_unimpl("SharedObject.close"));
+
+    obj->close();
+
     return as_value();
 }
 
@@ -799,7 +963,6 @@
 as_value
 sharedobject_getLocal(const fn_call& fn)
 {
-
     int swfVersion = getSWFVersion(fn);
 
     as_value objNameVal;
@@ -839,13 +1002,48 @@
 as_value
 sharedobject_getRemote(const fn_call& fn)
 {
-    boost::intrusive_ptr<SharedObject_as> obj =
-        ensureType<SharedObject_as>(fn.this_ptr);
-
-    UNUSED(obj);
-
-    LOG_ONCE(log_unimpl("SharedObject.getRemote()"));
-    return as_value();
+    GNASH_REPORT_FUNCTION;
+
+    int swfVersion = getSWFVersion(fn);
+    as_value objNameVal;
+
+    if (fn.nargs > 0) {
+        objNameVal = fn.arg(0);
+    }
+    
+    std::string objName = objNameVal.to_string_versioned(swfVersion);
+    if (objName.empty()) {
+        IF_VERBOSE_ASCODING_ERRORS(
+            std::ostringstream ss;
+            fn.dump_args(ss);
+            log_aserror("SharedObject.getRemote(%s): %s", 
+                _("missing object name"));
+        );
+        as_value ret;
+        ret.set_null();
+        return ret;
+    }
+
+    std::string root;
+    std::string persistance;
+    if (fn.nargs > 1) {
+        root = fn.arg(1).to_string_versioned(swfVersion);
+        persistance = fn.arg(2).to_string_versioned(swfVersion);
+    }
+
+    log_debug("SO name:%s, root:%s, persitance: %s", objName, root, 
persistance);
+
+    VM& vm = getVM(fn);
+
+    SharedObject_as* obj = vm.getSharedObjectLibrary().getRemote(objName, 
root, persistance);
+
+    as_value ret(obj);
+    log_debug("SharedObject.getRemote returning %s", ret);
+    
+//     string_table::key methodKey = NSV::PROP_ON_STATUS;
+//     callMethod(methodKey, as_value());
+    
+    return ret;
 }
 
 
@@ -870,6 +1068,7 @@
 as_value
 sharedobject_getDiskUsage(const fn_call& fn)
 {
+ //    GNASH_REPORT_FUNCTION;
     boost::intrusive_ptr<SharedObject_as> obj =
         ensureType<SharedObject_as>(fn.this_ptr);
 
@@ -882,7 +1081,8 @@
 
 as_value
 sharedobject_data(const fn_call& fn)
-{
+{ 
+//    GNASH_REPORT_FUNCTION;
     boost::intrusive_ptr<SharedObject_as> obj =
         ensureType<SharedObject_as>(fn.this_ptr);
     return as_value(obj->data());
@@ -934,28 +1134,25 @@
 
     struct stat st;
 
-    if (stat(filespec.c_str(), &st) != 0)
-    {
+    if (stat(filespec.c_str(), &st) != 0) {
         // No existing SOL file. A new one will be created.
         log_debug("No existing SOL %s found. Will create on flush/exit.",
-                filespec);
+                 filespec);
         return data;
     }
 
-    if (st.st_size < 28)
-    {
+    if (st.st_size < 28) {
         // A SOL file exists, but it was invalid. Count it as not existing.
         log_error("SharedObject::readSOL: SOL file %s is too short "
-                "(only %s bytes long) to be valid.", filespec, st.st_size);
+                 "(only %s bytes long) to be valid.", filespec, st.st_size);
         return data;
     }
-
+    
     boost::scoped_array<boost::uint8_t> sbuf(new boost::uint8_t[st.st_size]);
     const boost::uint8_t *buf = sbuf.get();
     const boost::uint8_t *end = buf + st.st_size;
 
-    try
-    {
+    try {
         std::ifstream ifs(filespec.c_str(), std::ios::binary);
         ifs.read(reinterpret_cast<char*>(sbuf.get()), st.st_size);
 
@@ -969,8 +1166,7 @@
         
         buf += 4; // skip past padding
 
-        if (buf >= end)
-        {
+        if (buf >= end) {
             // In this case there is no data member.
             log_error("SharedObject::readSOL: file ends before data segment");
             return data;
@@ -978,8 +1174,7 @@
 
         std::vector<as_object*> objRefs;
 
-        while (buf < end)
-        {
+        while (buf < end) {
             log_debug("SharedObject::readSOL: reading property name at "
                     "byte %s", buf - sbuf.get());
             // read property name
@@ -987,8 +1182,7 @@
                 ntohs(*(reinterpret_cast<const boost::uint16_t*>(buf)));
             buf += 2;
 
-            if( buf + len >= end )
-            {
+            if( buf + len >= end ) {
                 log_error("SharedObject::readSOL: premature end of input");
                 break;
             }
@@ -1018,10 +1212,10 @@
         }
         return data;
     }
-    catch (std::exception& e)
-    {
+
+    catch (std::exception& e) {
         log_error("SharedObject::readSOL: Reading SharedObject %s: %s", 
-                filespec, e.what());
+                 filespec, e.what());
         return 0;
     }
 
@@ -1107,6 +1301,7 @@
 void
 flushSOL(SharedObjectLibrary::SoLib::value_type& sol)
 {
+//    GNASH_REPORT_FUNCTION;
     sol.second->flush();
 }
 

=== modified file 'libcore/asobj/flash/net/SharedObject_as.h'
--- a/libcore/asobj/flash/net/SharedObject_as.h 2009-07-28 11:58:27 +0000
+++ b/libcore/asobj/flash/net/SharedObject_as.h 2009-08-04 17:39:22 +0000
@@ -22,10 +22,14 @@
 #include <string>
 #include <map>
 
+#include "NetConnection_as.h"
+
 // Forward declarations
 namespace gnash {
     class as_object;
-class ObjectURI;
+    class Network;
+//     class NetConnection_as;
+    class ObjectURI;
     class SharedObject_as;
     class VM;
 }
@@ -36,7 +40,7 @@
 {
 public:
 
-    typedef std::map<std::string, SharedObject_as*> SoLib;
+    typedef std::map<std::string, SharedObject_as *> SoLib;
 
     SharedObjectLibrary(VM& vm);
 
@@ -48,6 +52,14 @@
     ///
     SharedObject_as* getLocal(const std::string& name, const std::string& 
root);
 
+    /// Return a remote shared object with given name
+    ///
+    /// @param persistance false
+    /// May return NULL if name is invalid or can't access the given root
+    ///
+    SharedObject_as* getRemote(const std::string& name, const std::string& uri,
+       const std::string& persistance);
+
     void markReachableResources() const;
 
     // Drop all library items
@@ -64,9 +76,8 @@
     std::string _basePath;
 
     /// Base SOL dir
-    std::string _solSafeDir; 
-
-    SoLib _soLib;
+    std::string _solSafeDir;
+    SoLib      _soLib;
 };
 
 /// Initialize the global SharedObject class

=== modified file 'libcore/asobj/flash/net/net.am'
--- a/libcore/asobj/flash/net/net.am    2009-07-16 11:04:13 +0000
+++ b/libcore/asobj/flash/net/net.am    2009-08-04 03:05:56 +0000
@@ -55,7 +55,7 @@
 
 if BUILD_NETCONNECTION_AS3
 # NET_SOURCES += asobj/flash/net/NetConnection_as.cpp
-NET_HEADERS += asobj/flash/net/NetConnection_as.h
+#NET_HEADERS += asobj/flash/net/NetConnection_as.h
 endif
 
 if BUILD_NETSTREAM_AS3
@@ -78,7 +78,6 @@
 NET_HEADERS += asobj/flash/net/SharedObjectFlushStatus_as.h
 endif
 
-FIXME: already exists
 if BUILD_SHAREDOBJECT_AS3
 NET_SOURCES += asobj/flash/net/SharedObject_as.cpp
 NET_HEADERS += asobj/flash/net/SharedObject_as.h

=== modified file 'libcore/namedStrings.cpp'
--- a/libcore/namedStrings.cpp  2009-07-16 09:44:26 +0000
+++ b/libcore/namedStrings.cpp  2009-07-26 22:56:39 +0000
@@ -220,6 +220,7 @@
        string_table::svt( "Sprite", NSV::CLASS_SPRITE ),
        string_table::svt( "int", NSV::CLASS_INT ),
        string_table::svt( "TextFieldAutoSize", NSV::CLASS_TEXTFIELDAUTOSIZE),
+       string_table::svt( "onSync", NSV::PROP_ON_SYNC ),
        string_table::svt( "flash.display", NSV::NS_FLASH_DISPLAY ),
        string_table::svt( "flash.text", NSV::NS_FLASH_TEXT ),
        string_table::svt( "flash.geom", NSV::NS_FLASH_GEOM ),

=== modified file 'libcore/namedStrings.h'
--- a/libcore/namedStrings.h    2009-07-30 06:35:33 +0000
+++ b/libcore/namedStrings.h    2009-08-04 17:39:22 +0000
@@ -251,6 +251,7 @@
         PROP_WIDTH,
         PROP_X,
         PROP_Y,
+        PROP_ON_SYNC,
         INTERNAL_INTERFACES,
         INTERNAL_STACK_PARENT, // Any public property is unsafe
         INTERNAL_TYPE // The type name

=== modified file 'libnet/Makefile.am'
--- a/libnet/Makefile.am        2009-07-15 16:08:40 +0000
+++ b/libnet/Makefile.am        2009-07-26 01:56:07 +0000
@@ -50,7 +50,6 @@
 noinst_HEADERS = \
        cque.h \
        lirc.h \
-       handler.h \
        http.h \
        network.h \
        netstats.h \
@@ -63,7 +62,6 @@
 
 libgnashnet_la_SOURCES = \
        cque.cpp \
-       handler.cpp \
        lirc.cpp \
        http.cpp \
        network.cpp \

=== modified file 'libnet/http.cpp'
--- a/libnet/http.cpp   2009-03-26 19:23:30 +0000
+++ b/libnet/http.cpp   2009-07-26 01:56:07 +0000
@@ -42,7 +42,7 @@
 #include "cque.h"
 #include "log.h"
 #include "network.h"
-#include "handler.h"
+// #include "handler.h"
 #include "utility.h"
 #include "buffer.h"
 #include "diskstream.h"
@@ -70,7 +70,7 @@
 namespace gnash
 {
 
-extern map<int, Handler *> handlers;
+// extern map<int, Handler *> handlers;
 
 // FIXME, this seems too small to me.  --gnu
 static const int readsize = 1024;
@@ -81,7 +81,7 @@
     : _filetype(DiskStream::FILETYPE_HTML),
       _filesize(0),
       _keepalive(false),
-      _handler(0),
+//       _handler(0),
       _clientid(0),
       _index(0),
       _max_requests(0)
@@ -94,6 +94,7 @@
 //    _status_codes(CONTINUE, status);
 }
 
+#if 0
 HTTP::HTTP(Handler *hand) 
     : _filetype(DiskStream::FILETYPE_HTML),
       _filesize(0),
@@ -103,10 +104,11 @@
       _max_requests(0)
 {
 //    GNASH_REPORT_FUNCTION;
-    _handler = hand;
+//     _handler = hand;
     _version.major = 0;
     _version.minor = 0;
 }
+#endif
 
 HTTP::~HTTP()
 {

=== modified file 'libnet/http.h'
--- a/libnet/http.h     2009-03-25 22:31:57 +0000
+++ b/libnet/http.h     2009-07-26 01:56:07 +0000
@@ -34,7 +34,7 @@
 #include "amf.h"
 #include "cque.h"
 #include "rtmp.h"
-#include "handler.h"
+//#include "handler.h"
 #include "network.h"
 #include "buffer.h"
 #include "diskstream.h"
@@ -127,7 +127,7 @@
        int minor;
     } http_version_t;
     HTTP();
-    HTTP(Handler *hand);
+//     HTTP(Handler *hand);
     ~HTTP();
 
     // Check the Header fields to make sure they're valid values.
@@ -289,7 +289,7 @@
        { return _status_codes; }
     http_version_t *getVersion() { return &_version; }
     
-    void setHandler(Handler *hand) { _handler = hand; };
+//     void setHandler(Handler *hand) { _handler = hand; };
     void setDocRoot(const std::string &path) { _docroot = path; };
     std::string &getDocRoot() { return _docroot; };
     
@@ -327,7 +327,7 @@
     
     // Connection parameters we care about
     bool               _keepalive;
-    Handler            *_handler;
+//     Handler         *_handler;
     // These two field hold the data from an RTMPT message
     int                        _clientid;
     int                        _index;

=== modified file 'libnet/network.h'
--- a/libnet/network.h  2009-07-13 02:26:18 +0000
+++ b/libnet/network.h  2009-07-26 01:56:07 +0000
@@ -89,6 +89,7 @@
 const short RTMPT_PORT  = HTTP_PORT;
 const short RTMPTE_PORT = HTTP_PORT;
 const short RTMPTS_PORT = SSL_PORT;
+const short CGIBIN_PORT = 1234;
 
 #ifdef __OS2__
  typedef int    socklen_t;

=== modified file 'libnet/rtmp.cpp'
--- a/libnet/rtmp.cpp   2009-06-13 14:45:07 +0000
+++ b/libnet/rtmp.cpp   2009-07-26 01:56:07 +0000
@@ -40,7 +40,7 @@
 #include "cque.h"
 #include "network.h"
 #include "element.h"
-#include "handler.h"
+// #include "handler.h"
 #include "utility.h"
 #include "buffer.h"
 #include "GnashSleep.h"
@@ -72,7 +72,7 @@
 
 CQue incoming;
 
-extern std::map<int, Handler *> handlers;
+// extern std::map<int, Handler *> handlers;
 
 const char *content_str[] = {
     "None",
@@ -200,7 +200,7 @@
 
 RTMP::RTMP() 
     : _handshake(0),
-      _handler(0),
+//       _handler(0),
       _packet_size(0),
       _mystery_word(0),
       _timeout(1)
@@ -226,7 +226,7 @@
 //    GNASH_REPORT_FUNCTION;
     _properties.clear();
     delete _handshake;
-    delete _handler;
+//     delete _handler;
 
 //    delete _body;
 }

=== modified file 'libnet/rtmp.h'
--- a/libnet/rtmp.h     2009-04-01 22:53:00 +0000
+++ b/libnet/rtmp.h     2009-07-26 01:56:07 +0000
@@ -26,7 +26,7 @@
 
 #include "amf.h"
 #include "element.h"
-#include "handler.h"
+// #include "handler.h"
 #include "network.h"
 #include "buffer.h"
 #include "rtmp_msg.h"
@@ -224,7 +224,7 @@
     void addProperty(char *name, amf::Element &el);
     void addProperty(std::string &name, amf::Element &el);
     amf::Element &getProperty(const std::string &name);
-    void setHandler(Handler *hand) { _handler = hand; };
+//     void setHandler(Handler *hand) { _handler = hand; };
     int headerSize(boost::uint8_t header);
 
     rtmp_head_t *getHeader()    { return &_header; };
@@ -312,7 +312,7 @@
   protected:
     AMFProperties _properties;
     amf::Buffer        *_handshake;
-    Handler    *_handler;
+//     Handler *_handler;
     rtmp_head_t        _header;
     int         _packet_size;
     int         _mystery_word;

=== modified file 'libnet/rtmp_client.cpp'
--- a/libnet/rtmp_client.cpp    2009-04-02 15:04:09 +0000
+++ b/libnet/rtmp_client.cpp    2009-07-26 01:56:07 +0000
@@ -37,7 +37,7 @@
 #include "rtmp_client.h"
 #include "network.h"
 #include "element.h"
-#include "handler.h"
+// #include "handler.h"
 #include "utility.h"
 #include "buffer.h"
 #include "GnashSleep.h"
@@ -56,7 +56,7 @@
 // The rcfile is loaded and parsed here:
 static RcInitFile& rcfile = RcInitFile::getDefaultInstance();
 
-extern map<int, Handler *> handlers;
+// extern map<int, Handler *> handlers;
 
 RTMPClient::RTMPClient()
     : _connected(false),

=== modified file 'libnet/rtmp_client.h'
--- a/libnet/rtmp_client.h      2009-04-02 15:04:09 +0000
+++ b/libnet/rtmp_client.h      2009-07-26 01:56:07 +0000
@@ -28,7 +28,7 @@
 #include "rtmp_msg.h"
 #include "amf.h"
 #include "element.h"
-#include "handler.h"
+// #include "handler.h"
 #include "network.h"
 #include "buffer.h"
 #include "dsodefs.h"

=== modified file 'libnet/rtmp_msg.cpp'
--- a/libnet/rtmp_msg.cpp       2009-03-28 18:36:39 +0000
+++ b/libnet/rtmp_msg.cpp       2009-07-26 01:56:07 +0000
@@ -35,7 +35,7 @@
 #include "rtmp_msg.h"
 #include "network.h"
 #include "element.h"
-#include "handler.h"
+// #include "handler.h"
 #include "utility.h"
 #include "buffer.h"
 

=== modified file 'libnet/rtmp_msg.h'
--- a/libnet/rtmp_msg.h 2009-03-27 00:38:36 +0000
+++ b/libnet/rtmp_msg.h 2009-07-26 01:56:07 +0000
@@ -25,7 +25,7 @@
 #include "amf.h"
 #include "rtmp.h"
 #include "element.h"
-#include "handler.h"
+// #include "handler.h"
 #include "network.h"
 #include "buffer.h"
 

=== modified file 'testsuite/network.all/Makefile.am'
--- a/testsuite/network.all/Makefile.am 2009-07-14 15:42:03 +0000
+++ b/testsuite/network.all/Makefile.am 2009-07-26 22:59:29 +0000
@@ -22,6 +22,8 @@
 abs_builddir=$(shell cd $(top_builddir)/testsuite/network.all; pwd)
 abs_mediadir = $(shell cd $(srcdir)/../media; pwd)
 
+HAXE_FLAGS = -cp $(srcdir) -cp 
$(top_srcdir)/testsuite/misc-haxe.all/classes.all
+
 CLEANFILES =  \
        gnash-dbg.log \
        site.exp.bak \
@@ -71,7 +73,8 @@
 
 check_SCRIPTS = \
        http.swf \
-       rtmp.swf
+       rtmp.swf \
+       SharedObject_as.swf
 
 # if MAKESWF_SUPPORTS_PREBUILT_CLIPS
 #   check_SCRIPTS += remotingTestRunner
@@ -150,6 +153,18 @@
 # TEST_CASES += red5testRunner
 endif
 
+SUFFIXES = hx swf
+
+# build multiple output formats from the same test case. exit with failure if
+# the test case doesn't compile for v9, it's a test cases bug. Not all classes
+# support all versions, so in those cases justy ignore the errors as it's less
+# messy than testing for each test case to see if it supports that version.
+.hx.swf:
+       address@hidden $(@F) | sed -e 's:_as:_asv9:'`; \
+       $(HAXE) -swf-version 9 $(HAXE_FLAGS) -swf $${newname} -main 
$(@F:%.swf=%.hx)
+       address@hidden $(@F) | sed -e 's:_as:_asv8:'`; \
+       $(HAXE) -swf-version 8  $(HAXE_FLAGS) -swf $${newname} -main 
$(@F:%.swf=%.hx)
+
 check-DEJAGNU: site-update $(check_PROGRAMS)
        @runtest=$(RUNTEST); \
        if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \

=== added file 'testsuite/network.all/SharedObject_as.hx'
--- a/testsuite/network.all/SharedObject_as.hx  1970-01-01 00:00:00 +0000
+++ b/testsuite/network.all/SharedObject_as.hx  2009-08-04 03:13:31 +0000
@@ -0,0 +1,131 @@
+// SharedObject_as.hx:  ActionScript 3 "SharedObject" class, for Gnash.
+//
+// Generated on: 20090528 by "bnaugle". Remove this
+// after any hand editing loosing changes.
+//
+//   Copyright (C) 2009 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+//
+
+// This test case must be processed by CPP before compiling to include the
+//  DejaGnu.hx header file for the testing framework support.
+
+
+#if flash9
+import flash.net.SharedObject;
+import flash.display.MovieClip;
+import flash.net.NetConnection;
+import flash.events.NetStatusEvent;
+import flash.net.NetStream;
+#else
+import flash.MovieClip;
+import flash.SharedObject;
+import flash.NetConnection;
+import flash.NetStream;
+#end
+import flash.Lib;
+import Type;
+import Std;
+
+// import our testing API
+import DejaGnu;
+
+// Class must be named with the _as suffix, as that's the same name as the 
file.
+class SharedObject_as {
+    static var undef = untyped __global__[ "undefined" ];
+    static var hostname : String;
+    static var rtmptport : String;
+    static var rtmpport : String;
+    static var rtmpuri : String;
+
+    static function main() {
+       
+       // -P FlashVars='hostname=localhost,rtmptport5080=rtmpport=1935'
+       if (hostname == undef) {
+           hostname="localhost";
+           DejaGnu.note("No hostname specified, defaulting to "+hostname);
+       }
+       
+       if (rtmptport == undef) {
+           rtmptport = "5080";
+           DejaGnu.note("No RTMPT port specified, defaulting to "+rtmptport);
+       }
+       
+       if (rtmpport == undef) {
+           rtmpport = "1935";
+           DejaGnu.note("No RTMP port specified, defaulting to "+rtmpport);
+       }
+       
+       var nc:NetConnection = new NetConnection();
+       // The Adobe flash player only supports remoting with RTMP
+       rtmpuri = "rtmp://"+hostname+":"+rtmpport+"/fitcDemo";
+       
+#if flash9
+        var x1:SharedObject = SharedObject.getRemote("sharedobjecttest", 
rtmpuri, true);
+#else
+       var x1:SharedObject = SharedObject.getRemote("sharedobjecttest", 
rtmpuri, true);
+#end         
+        if (Std.is(x1, SharedObject)) {
+            DejaGnu.pass("SharedObject class exists");
+        } else {
+            DejaGnu.fail("SharedObject class doesn't exist");
+        }
+        DejaGnu.note("SharedObject type is "+Type.typeof(x1));
+
+//     var ns:NetStream = new NetStream(nc);
+#if flash9
+//     nc.addEventListener(NetStatusEvent.NET_STATUS, ncOnStatus);
+#else
+       nc.setID = function(id) {
+           DejaGnu.note("Got a setID() from "+rtmpuri);
+       }
+        x1.onStatus = function(e):Void {
+           DejaGnu.note("Got onStatus from "+rtmpuri);
+           if (e.level == "error") {
+               DejaGnu.note("ERROR: " +e.code);
+           }
+       };
+        x1.onSync = function(list):Void {
+           DejaGnu.note("Got onSync from "+rtmpuri);
+           DejaGnu.note(list[0].code);
+       };
+//         DejaGnu.note(e.code);
+//         DejaGnu.note(e.description);
+#end
+       x1.connect(nc);
+
+//     Reflect.callMethod(x1, Reflect.field(x1, "connect"), []);
+       DejaGnu.note("Connecting to "+rtmpuri);
+
+       x1.send("sharedobjecttest", "Hello World");
+
+#if flash9
+       x1.setDirty("data");
+
+       x1.setProperty("data", nc);
+#end
+
+// Call this after finishing all tests. It prints out the totals.
+    DejaGnu.done();
+    }
+    
+}
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
+


reply via email to

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