[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r9685: add new options for threading
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r9685: add new options for threading |
Date: |
Sun, 02 Nov 2008 18:01:42 -0700 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9685
committer: address@hidden
branch nick: rtmp
timestamp: Sun 2008-11-02 18:01:42 -0700
message:
add new options for threading
modified:
cygnal/crc.cpp
cygnal/crc.h
cygnal/testsuite/cygnal.all/test_crc.cpp
=== modified file 'cygnal/crc.cpp'
--- a/cygnal/crc.cpp 2008-11-01 14:52:14 +0000
+++ b/cygnal/crc.cpp 2008-11-03 01:01:42 +0000
@@ -58,7 +58,10 @@
CRcInitFile::CRcInitFile()
: _port_offset(0),
_testing(false),
- _threading(false)
+ _threading(false),
+ _fdthread(100),
+ _netdebug(false),
+ _admin(false)
{
// GNASH_REPORT_FUNCTION;
loadFiles();
@@ -174,6 +177,8 @@
bool test;
bool threads;
+ bool netdebug;
+ bool admin;
uint32_t num;
// Get the standard options inherited froom Gnash's config file
@@ -183,12 +188,20 @@
useActionDump(test);
else if ( extractNumber(num, "verbosity", variable, value) )
verbosityLevel(num);
+
// Get the options specific to Cygnal's config file.
+ else if ( extractSetting(admin, "admin", variable, value) )
+ setAdminFlag(admin);
+ else if ( extractSetting(netdebug, "netdebug", variable, value) )
+ setNetDebugFlag(netdebug);
else if ( extractSetting(test, "testing", variable, value) )
setTestingFlag(test);
else if ( extractSetting(threads, "threading", variable, value) )
setThreadingFlag(threads);
- else extractNumber((uint32_t&)_port_offset, "portOffset",
variable, value);
+ else if (extractNumber(num, "fdThread", variable, value) )
+ setFDThread(num);
+ else if (extractNumber(num, "portOffset", variable, value) )
+ setPortOffset(num);;
} while (!in.eof());
=== modified file 'cygnal/crc.h'
--- a/cygnal/crc.h 2008-10-28 14:46:59 +0000
+++ b/cygnal/crc.h 2008-11-03 01:01:42 +0000
@@ -34,7 +34,7 @@
/// This namespace is for all the Cygnal specific classes not used by
/// anything else in Gnash.
namespace cygnal {
-
+
/// \class cygnal::CRcInitFile
/// This class handles reading values from the Cygnal
/// configuration file, .cygnalrc, and into a form we can use in
@@ -52,35 +52,75 @@
/// .cygnalrc file, plus the Cygnal specific file has
/// options only used by Cygnal.
bool loadFiles();
-
+
/// \brief Parse and load configuration file
bool parseFile(const std::string& filespec);
-
+
int getPortOffset() { return _port_offset; };
void setPortOffset(int x) { _port_offset = x; };
- int getTestingFlag() { return _testing; };
+ int getFDThread() { return _fdthread; };
+ void setFDThread(int x) { _fdthread = x; };
+
+ bool getTestingFlag() { return _testing; };
void setTestingFlag(bool x) { _testing = x; };
- int getThreadingFlag() { return _threading; };
+ bool getThreadingFlag() { return _threading; };
void setThreadingFlag(bool x) { _threading = x; };
-
+
+ bool getNetDebugFlag() const { return _netdebug; }
+ void setNetDebugFlag(bool x) { _netdebug = x; }
+
+ bool getAdminFlag() const { return _admin; }
+ void setAdminFlag(bool x) { _admin = x; }
+
/// \brief Dump the internal data of this class in a human readable form.
/// @remarks This should only be used for debugging purposes.
void dump() const { dump(std::cerr); }
-
+
/// \overload dump(std::ostream& os) const
void dump(std::ostream& os) const;
-
-private:
+
+ private:
/// Construct only by getDefaultInstance()
CRcInitFile();
/// Never destroy (TODO: add a destroyDefaultInstance)
~CRcInitFile();
-
+
+ /// \var _port_offset
+ /// This is an offset applied to all priviledged tcp/ip
+ /// ports. This enables the port number to be shifted into
+ /// the unpriviledged range (anything about 1024) so one
+ /// doesn't have to be root.
int _port_offset;
+
+ /// \var _testing
+ /// Turn on special output format to support Gnash
+ /// testing.
bool _testing;
+
+ /// \var _threading
+ /// Disable threading in the server I/O as much as
+ /// possible to make debugging easier. This is to only be
+ /// used by developers
bool _threading;
+
+ /// \var _fdthread
+ /// The number of file descriptors to be watched by each
+ /// dispatch thread. When threading is disabled, this is
+ /// also disabled, as all the file descriptors are watched
+ /// by one one thread as an aid to debugging.
+ size_t _fdthread;
+
+ /// \var _netdebug
+ /// Toggles very verbose debugging info from the network Network
+ /// class.
+ bool _netdebug;
+
+ /// \var _admin
+ /// This toggles whether the admin thread is started or
+ /// not, also to reduce complecity when debugging.
+ bool _admin;
};
/// \brief Dump to the specified output stream.
=== modified file 'cygnal/testsuite/cygnal.all/test_crc.cpp'
--- a/cygnal/testsuite/cygnal.all/test_crc.cpp 2008-01-21 20:55:39 +0000
+++ b/cygnal/testsuite/cygnal.all/test_crc.cpp 2008-11-03 01:01:42 +0000
@@ -97,6 +97,30 @@
runtest.fail ("getPortOffset");
}
+ if (crc.getAdminFlag() == false) {
+ runtest.pass ("getAdminFlag");
+ } else {
+ runtest.fail ("getAdminFlag");
+ }
+
+ if (crc.getTestingFlag() == false) {
+ runtest.pass ("getTestingFlag");
+ } else {
+ runtest.fail ("getTestingFlag");
+ }
+
+ if (crc.getNetDebugFlag() == false) {
+ runtest.pass ("getNetDebugFlag");
+ } else {
+ runtest.fail ("getNetDebugFlag");
+ }
+
+ if (crc.getFDThread() == 10) {
+ runtest.pass ("getFDThread");
+ } else {
+ runtest.fail ("getFDThread");
+ }
+
crc.dump();
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r9685: add new options for threading,
rob <=