gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r10028: get the baseURL when construc


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r10028: get the baseURL when constructing the URL for ::call()
Date: Tue, 24 Mar 2009 10:35:22 -0600
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10028
committer: address@hidden
branch nick: rtmp
timestamp: Tue 2009-03-24 10:35:22 -0600
message:
  get the baseURL when constructing the URL for ::call()
modified:
  libcore/asobj/NetConnection_as.cpp
=== modified file 'libcore/asobj/NetConnection_as.cpp'
--- a/libcore/asobj/NetConnection_as.cpp        2009-03-20 00:00:54 +0000
+++ b/libcore/asobj/NetConnection_as.cpp        2009-03-24 16:35:22 +0000
@@ -239,6 +239,14 @@
     const movie_root& mr = _vm.getRoot();
     URL url(uri, mr.runInfo().baseURL());
 
+    log_debug("%s: URI is %s, URL protocol is %s, path is %s, hostname is %s, 
port is %s", __PRETTY_FUNCTION__,
+             _uri, 
+             url.protocol(),
+              url.path(),
+             url.hostname(),
+             url.port()
+       );
+
     // This is for remoting
     if (!URLAccessManager::allow(url)) {
         log_security(_("Gnash is not allowed to NetConnection.connect to %s"), 
url);
@@ -268,7 +276,9 @@
 void
 NetConnection_as::setURI(const std::string& uri)
 {
+//     GNASH_REPORT_FUNCTION;    
     init_readonly_property("uri", &netconnection_uri);
+//     log_debug("%s: URI is %s", __PRETTY_FUNCTION__, uri);
     _uri = uri;
 }
 
@@ -279,8 +289,17 @@
 {
     GNASH_REPORT_FUNCTION;
 
-    URL url(_uri);
+    const movie_root& mr = _vm.getRoot();
+    URL url(_uri, mr.runInfo().baseURL());
 
+    log_debug("%s: URI is %s, URL protocol is %s, path is %s, hostname is %s, 
port is %s", __PRETTY_FUNCTION__,
+             _uri, 
+             url.protocol(),
+              url.path(),
+             url.hostname(),
+             url.port()
+       );
+    
     // The values for the connect call were set in ::connect(), but according
     // to documentation, the connection isn't actually started till the first
     // ()call(). My guess is back in the days of non-persistant network
@@ -291,16 +310,19 @@
        short port = strtol(url.port().c_str(), NULL, 0) & 0xffff;
        if ((url.protocol() == "rtmpt")
            || (url.protocol() == "http")) {
+           if (port == 0) {
+               port = gnash::RTMPT_PORT;
+           }
            _http_client.reset(new HTTP);
            _http_client->toggleDebug(true);
            if (!_http_client->createClient(url.hostname(), port)) {
-               log_error("Can't connect to server %s on port %s",
-                         url.hostname(), url.port());
+               log_error("Can't connect to server %s on port %hd",
+                         url.hostname(), port);
                notifyStatus(CONNECT_FAILED);
                return;
            } else {
-               log_debug("Connected to server %s on port %s",
-                         url.hostname(), url.port());
+               log_debug("Connected to server %s on port %hd",
+                         url.hostname(), port);
                notifyStatus(CONNECT_SUCCESS);
                _isConnected = true;
            }
@@ -589,7 +611,7 @@
 as_value
 netconnection_new(const fn_call& /* fn */)
 {
-    GNASH_REPORT_FUNCTION;
+//     GNASH_REPORT_FUNCTION;
 
     NetConnection_as* nc = new NetConnection_as;
 
@@ -612,7 +634,7 @@
 as_value
 netconnection_connect(const fn_call& fn)
 {
-    GNASH_REPORT_FUNCTION;
+//     GNASH_REPORT_FUNCTION;
 
     boost::intrusive_ptr<NetConnection_as> ptr =
         ensureType<NetConnection_as>(fn.this_ptr); 
@@ -626,7 +648,7 @@
     }
 
     const as_value& uri = fn.arg(0);
-
+    
     const VM& vm = ptr->getVM();
     const std::string& uriStr = uri.to_string_versioned(vm.getSWFVersion());
     


reply via email to

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