gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/rtmp r9761: Use the port offset for the RT


From: rob
Subject: [Gnash-commit] /srv/bzr/gnash/rtmp r9761: Use the port offset for the RTMP port too to be consistant.
Date: Fri, 21 Nov 2008 09:41:31 -0700
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9761
committer: address@hidden
branch nick: rtmp
timestamp: Fri 2008-11-21 09:41:31 -0700
message:
  Use the port offset for the RTMP port too to be consistant.
  Don't "while(1)", add a real boolean test for being done.
modified:
  cygnal/cygnal.cpp
  libnet/cache.cpp
=== modified file 'cygnal/cygnal.cpp'
--- a/cygnal/cygnal.cpp 2008-11-20 20:58:49 +0000
+++ b/cygnal/cygnal.cpp 2008-11-21 16:41:31 +0000
@@ -145,11 +145,12 @@
        << _("  -h,  --help          Print this help and exit") << endl
        << _("  -V,  --version       Print version information and exit") << 
endl
        << _("  -v,  --verbose       Output verbose debug info") << endl
-       << _("  -p   --port-offset   RTMPT port offset") << endl
+       << _("  -p   --port-offset   Port offset for debugging") << endl
        << _("  -n,  --netdebug      Turn on net debugging messages") << endl
-       << _("  -t,  --testing       Turn on special Gnash testing support") << 
endl
+        << _("  -t,  --testing       Turn on special Gnash testing support") 
<< endl
        << _("  -a,  --admin         Enable the administration thread") << endl
        << _("  -r,  --root          Document root for all files") << endl
+       << _("  -c,  --threads       Enable Threading") << endl
        << endl;
 }
 
@@ -173,7 +174,8 @@
         { 'n', "netdebug",      Arg_parser::no  },
         { 't', "testing",       Arg_parser::no  },
         { 'a', "admin",         Arg_parser::no  },
-        { 'r', "root",          Arg_parser::yes }
+        { 'r', "root",          Arg_parser::yes },
+        { 'c', "threads",       Arg_parser::no }
         };
 
     Arg_parser parser(argc, argv, opts);
@@ -232,6 +234,9 @@
          case 'r':
              docroot = parser.argument(i).c_str();
              break;
+         case 'c':
+             crcfile.setThreadingFlag(true);
+             break;
          case 'n':
              netdebug = true;
              break;
@@ -282,7 +287,7 @@
       // Incomming connection handler for port 1935, RTMP. As RTMP
       // is not a priviledged port, we just open it without an offset.
       Handler::thread_params_t rtmp_data;
-      rtmp_data.port = gnash::RTMP_PORT;
+      rtmp_data.port = port_offset + gnash::RTMP_PORT;
       rtmp_data.netfd = 0;
       rtmp_data.filespec = docroot;
       if (crcfile.getThreadingFlag()) {
@@ -469,7 +474,7 @@
            };
        } while (ret > 0);
         log_debug("admin_handler: Done...!\n");
-       net.closeNet();         // this shuts down this socket connection
+//     net.closeNet();         // this shuts down this socket connection
     }
     net.closeConnection();             // this shuts down the server on this 
connection
 
@@ -483,7 +488,7 @@
     GNASH_REPORT_FUNCTION;
     int fd = 0;
 //    list<Handler *> *handlers = reinterpret_cast<list<Handler *> 
*>(args->handle);
-
+    bool done = false;
     static int tid = 0;
     Network net;
     if (netdebug) {
@@ -545,30 +550,30 @@
        if (args->port == (port_offset + RTMPT_PORT)) {
            hand->addPollFD(fds, http_handler);
        }
-//     if (args->port == RTMP_PORT) {
-//         hand->addPollFD(fds, rtmp_handler);
-//     }
+//     if (args->port == RTMP_PORT) {
+//         hand->addPollFD(fds, rtmp_handler);
+//     }
        // if supporting multiple threads
+       args->handler = hand;
        if (crcfile.getThreadingFlag()) {
-           hand = new Handler;
-           args->handler = hand;
+           log_debug("Multi-threaded mode for fd #%d", args->netfd);
            log_debug("Starting handler: %x for fd #%d", (void *)hand, 
args->netfd);
+#if 0
            if (args->port == (port_offset + RTMPT_PORT)) {
                boost::thread handler(boost::bind(&http_handler, args));
            }
-           if (args->port == RTMP_PORT) {
+           if (args->port == (port_offset + RTMP_PORT)) {
                boost::thread handler(boost::bind(&rtmp_handler, args));
            }
-           dispatch_handler(args);
-//         net.closeNet(args->netfd);
+#endif
+           boost::thread handler(boost::bind(&dispatch_handler, args));
        } else {                // single threaded
            log_debug("Single threaded mode for fd #%d", args->netfd);
-           args->handler = hand;
            dispatch_handler(args);
        }
-       //
+//     net.closeNet(args->netfd);              // this shuts down this socket 
connection
        log_debug("Restarting loop for next connection for port %d...", 
args->port);
-    } while(1);
+    } while(!done);
     
     // All threads should exit now.
     alldone.notify_all();
@@ -600,8 +605,8 @@
                    if ((it->revents & POLLRDHUP) || (it->revents & POLLNVAL))  
{
                        log_debug("Revents has a POLLRDHUP or POLLNVAL set to 
%d for fd #%d",
                                  it->revents, it->fd);
-                       hand->erasePollFD(it);
-                       net.closeNet(it->fd);
+                       hand->erasePollFD(it);
+                       net.closeNet(it->fd);
                    }
                    log_debug("Got something on fd #%d, 0x%x", it->fd, 
it->revents);
                    hand->getEntry(it->fd)(args);

=== modified file 'libnet/cache.cpp'
--- a/libnet/cache.cpp  2008-11-20 20:57:23 +0000
+++ b/libnet/cache.cpp  2008-11-21 16:41:31 +0000
@@ -65,6 +65,7 @@
 Cache::~Cache()
 {
 //    GNASH_REPORT_FUNCTION;
+//    dump();
 }
 
 Cache&


reply via email to

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