gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash server/asobj/SharedObject.cpp ChangeLog l...


From: Rob Savoye
Subject: [Gnash-commit] gnash server/asobj/SharedObject.cpp ChangeLog l...
Date: Mon, 31 Dec 2007 02:17:02 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    07/12/31 02:17:02

Modified files:
        server/asobj   : SharedObject.cpp 
        .              : ChangeLog 
        libamf         : element.cpp element.h rtmp.cpp rtmp.h sol.cpp 

Log message:
                * server/asobj/SharedObject.cpp: Handle the second argument to
                getLocal() correctly, which doesn't add either the domain nor 
the
                swf file name. Fixes the Shared Object part of #21377, which now
                gets to the next frame.
                * libamf/element.{cpp,h}: Add a few constructors that take a
                std::string argument for the name.
                * libamf/sol.cpp: Remove bogus error message.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/SharedObject.cpp?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5278&r2=1.5279
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/element.cpp?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/element.h?cvsroot=gnash&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/rtmp.cpp?cvsroot=gnash&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/rtmp.h?cvsroot=gnash&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/sol.cpp?cvsroot=gnash&r1=1.9&r2=1.10

Patches:
Index: server/asobj/SharedObject.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/SharedObject.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- server/asobj/SharedObject.cpp       31 Dec 2007 00:51:05 -0000      1.23
+++ server/asobj/SharedObject.cpp       31 Dec 2007 02:17:01 -0000      1.24
@@ -79,9 +79,9 @@
 
     void operator() (string_table::key key, const as_value& val) const
         {
-//            GNASH_REPORT_FUNCTION;
+            GNASH_REPORT_FUNCTION;
             AMF amf;
-            Element *el;
+            Element *el = 0;
 
             string& name = const_cast<string &>(_st.string_table::value(key));
 
@@ -108,8 +108,10 @@
                 el = new amf::Element(name, dub);
             }
             
+            if (el) {
             _sol.addObj(el);
         }
+        }
 };
 
 static void
@@ -258,7 +260,7 @@
 
     string newspec = rcfile.getSOLSafeDir();
     if (newspec.size() == 0) {
-        newspec = "./";
+        newspec = "/tmp/";
     }
     
     char *domain;
@@ -274,6 +276,12 @@
     URL url(url_s, baseurl);
 //    log_msg(_("BASE URL=%s (%s)"), baseurl.str().c_str(), 
url.hostname().c_str());
     
+    string swfile;
+    pos = baseurl.str().rfind("/", baseurl.str().size());
+    if (pos != string::npos) {
+        swfile = baseurl.str().substr(pos + 1, baseurl.str().size());
+    }
+    
     if (url.hostname().size() == 0) {
         strcpy(domain, "localhost");
     }
@@ -284,16 +292,18 @@
         return as_value(false);
      }
 
-    newspec += domain;
-    newspec += "/";    
+    // The optional second argument drops the domain and the swf file name
     if (fn.nargs == 2) {
         rootdir = fn.arg(1).to_string();
-//        log_msg("The root dir is now %s", rootdir.c_str());
+        log_debug("The rootdir is: %s", rootdir.c_str());
         newspec += rootdir;
     } else {
-        log_debug("If I had my swf filename. I'd be writing it to the .sol 
file path");
-    }
     newspec += "/";    
+        newspec += domain;
+        newspec += "/";
+        newspec += swfile;
+        newspec += "/";
+    }
         
     if (obj->getFilespec().find("/", 0) != string::npos) {
         typedef tokenizer<char_separator<char> > Tok;
@@ -354,7 +364,7 @@
             ptr->set_member(st.string_table::find(el->getName()), 
as_value(dub));
         } 
         if (el->getType() == Element::BOOLEAN) {
-            if (el[0] == true) {
+            if (el->to_bool() == true) {
                 ptr->set_member(st.string_table::find(el->getName()), 
as_value(true));
             } else {
                 ptr->set_member(st.string_table::find(el->getName()), 
as_value(false));

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5278
retrieving revision 1.5279
diff -u -b -r1.5278 -r1.5279
--- ChangeLog   31 Dec 2007 00:51:05 -0000      1.5278
+++ ChangeLog   31 Dec 2007 02:17:01 -0000      1.5279
@@ -1,5 +1,13 @@
 2007-12-30  Rob Savoye  <address@hidden>
 
+       * server/asobj/SharedObject.cpp: Handle the second argument to
+       getLocal() correctly, which doesn't add either the domain nor the
+       swf file name. Fixes the Shared Object part of #21377, which now
+       gets to the next frame.
+       * libamf/element.{cpp,h}: Add a few constructors that take a
+       std::string argument for the name.
+       * libamf/sol.cpp: Remove bogus error message.
+       
        * server/asobj/SharedObject.cpp: Use Element class instead of
        amf_element_t everywhere. 
        

Index: libamf/element.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/element.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libamf/element.cpp  31 Dec 2007 00:26:48 -0000      1.1
+++ libamf/element.cpp  31 Dec 2007 02:17:02 -0000      1.2
@@ -104,12 +104,24 @@
     init(name, indata);
 }
 
+Element::Element(string &name, string &indata)
+{
+//    GNASH_REPORT_FUNCTION;
+    init(name, indata);
+}
+
 Element::Element(const char *name, bool indata)
 {
 //    GNASH_REPORT_FUNCTION;
     init(name, indata);
 }
 
+Element::Element(string &name, bool indata)
+{
+//    GNASH_REPORT_FUNCTION;
+    init(name, indata);
+}
+
 Element::Element(bool indata)
 {
 //    GNASH_REPORT_FUNCTION;

Index: libamf/element.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/element.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- libamf/element.h    31 Dec 2007 00:26:48 -0000      1.1
+++ libamf/element.h    31 Dec 2007 02:17:02 -0000      1.2
@@ -64,8 +64,10 @@
     Element(const char *name, double data);
     Element(std::string &data);
     Element(const char *name, std::string &data);
+    Element(std::string &name, std::string &data);
     Element(bool data);
     Element(const char *name, bool data);
+    Element(std::string &name, bool data);
     ~Element();
     void clear();
     boost::uint8_t *init(boost::uint8_t *data);

Index: libamf/rtmp.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/rtmp.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- libamf/rtmp.cpp     15 Dec 2007 06:58:40 -0000      1.18
+++ libamf/rtmp.cpp     31 Dec 2007 02:17:02 -0000      1.19
@@ -37,6 +37,13 @@
 namespace gnash
 {
 
+// These are the textual responses
+const char *response_str[] = {
+    "/onStatus",
+    "/onResult",
+    "/onDebugEvents"
+};
+
 RTMPproto::RTMPproto() 
 {
 //    GNASH_REPORT_FUNCTION;

Index: libamf/rtmp.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/rtmp.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- libamf/rtmp.h       31 Dec 2007 00:26:48 -0000      1.10
+++ libamf/rtmp.h       31 Dec 2007 02:17:02 -0000      1.11
@@ -37,13 +37,6 @@
 #define RTMP_BODY_SIZE 1536
 #define MAX_AMF_INDEXES 64
 
-// These are the textual responses
-const char *response_str[] = {
-    "/onStatus",
-    "/onResult",
-    "/onDebugEvents"
-};
-
 class DSOEXPORT RTMPproto : public Protocol
 {
 public:

Index: libamf/sol.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/sol.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- libamf/sol.cpp      31 Dec 2007 00:26:48 -0000      1.9
+++ libamf/sol.cpp      31 Dec 2007 02:17:02 -0000      1.10
@@ -355,7 +355,7 @@
         return true;
     }
 
-    log_error("Couldn't open file: %s", strerror(errno));
+//    log_error("Couldn't open file: %s", strerror(errno));
     return false;
 }
 




reply via email to

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