Changeset 545
- Timestamp:
- 09/20/08 15:44:51 (2 months ago)
- Location:
- trunk/daemon
- Files:
-
- 7 modified
-
orbited-debug.cfg (modified) (1 diff)
-
orbited/cometsession.py (modified) (2 diffs)
-
orbited/config.py (modified) (2 diffs)
-
orbited/start.py (modified) (4 diffs)
-
orbited/static/Orbited.js (modified) (9 diffs)
-
orbited/transports/htmlfile.py (modified) (3 diffs)
-
setup.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/orbited-debug.cfg
r524 r545 2 2 reactor=epoll 3 3 proxy.enabled=1 4 session.ping_interval = 35 session.ping_timeout = 44 session.ping_interval = 60 5 session.ping_timeout = 70 6 6 7 7 [listen] -
trunk/daemon/orbited/cometsession.py
r536 r545 320 320 if not self.open: 321 321 self.open = True 322 self.packetId += 1323 322 self.cometTransport.sendPacket("open", self.packetId) 324 323 self.cometTransport.flush() … … 373 372 if ackId <= self.lastAckId: 374 373 return 375 for i in range(ackId - self.lastAckId - 1): # -1 as the OPEN packet need not be ack'ed374 for i in range(ackId - self.lastAckId): 376 375 self.unackQueue.pop(0) 377 376 self.lastAckId = ackId -
trunk/daemon/orbited/config.py
r488 r545 50 50 return True 51 51 52 def setup(argv): 52 defaultPaths = [ 53 os.path.join('/', 'etc', 'orbited.cfg'), 54 os.path.join('/', 'Program Files', 'Orbited', 'etc', 'orbited.cfg'), 55 'orbited.cfg', 56 ] 57 58 def setup(argv, paths=defaultPaths): 53 59 parser = OptionParser() 54 60 parser.add_option( … … 67 73 if not options.config: 68 74 # no config file specified, try to search it. 69 paths = [70 os.path.join('/', 'etc', 'orbited.cfg'),71 os.path.join('/', 'Program Files', 'Orbited', 'etc', 'orbited.cfg'),72 'orbited.cfg',73 ]74 75 for path in paths: 75 76 if os.path.exists(path): -
trunk/daemon/orbited/start.py
r417 r545 26 26 logger.info('%s protocol active' % config_key) 27 27 28 def _setup_static(root ):28 def _setup_static(root, config): 29 29 from twisted.web import static 30 for key, val in config .map['[static]'].items():30 for key, val in config['[static]'].items(): 31 31 if key == 'INDEX': 32 32 key = '' … … 64 64 65 65 _setup_protocols(root) 66 _setup_static(root) 66 _setup_static(root, config.map) 67 start_listening(site, config.map, logger) 68 reactor.run() 67 69 68 for addr in config.map['[listen]']: 70 def start_listening(site, config, logger): 71 from twisted.internet import reactor 72 for addr in config['[listen]']: 69 73 url = urlparse.urlparse(addr) 70 74 hostname = url.hostname or '' … … 74 78 elif url.scheme == 'https': 75 79 from twisted.internet import ssl 76 crt = config .map['[ssl]']['crt']77 key = config .map['[ssl]']['key']80 crt = config['[ssl]']['crt'] 81 key = config['[ssl]']['key'] 78 82 try: 79 83 ssl_context = ssl.DefaultOpenSSLContextFactory(key, crt) … … 89 93 sys.exit(-1) 90 94 91 reactor.run()92 95 93 96 if __name__ == "__main__": -
trunk/daemon/orbited/static/Orbited.js
r541 r545 1 1 2 // NOTE: to log/debug with Orbited, there are two methods: 2 3 // Use firebug … … 362 363 363 364 364 365 Orbited.legacy = {} 366 //Orbited.web.connect = function() { 367 // 368 //} 365 369 366 370 Orbited.CometSession = function() { … … 589 593 ;;; self.logger.debug('transportOnClose'); 590 594 if (self.readyState < self.READY_STATE_CLOSED) { 591 doClose(Orbited.Statuses.ServerClosedConnection) 595 try { 596 doClose(Orbited.Statuses.ServerClosedConnection) 597 } 598 catch(e) { 599 // Fix for navigation-close 600 return 601 } 592 602 } 593 603 } … … 1159 1169 // If we got a 200, then we're in business 1160 1170 if (status == 200) { 1161 heartbeatTimer = window.setTimeout(heartbeatTimeout, Orbited.settings.HEARTBEAT_TIMEOUT); 1171 try { 1172 heartbeatTimer = window.setTimeout(heartbeatTimeout, Orbited.settings.HEARTBEAT_TIMEOUT); 1173 } 1174 catch(e) { 1175 // Happens after navigation 1176 self.close() 1177 return 1178 } 1162 1179 var testtimer = heartbeatTimer; 1163 1180 } … … 1241 1258 // self.logger.debug('do abort..') 1242 1259 xhr.abort(); 1243 window.clearTimeout(heartbeatTimer); 1260 window.clearTimeout(heartbeatTimer); 1244 1261 } 1245 1262 else { … … 1304 1321 window.clearTimeout(heartbeatTimer); 1305 1322 ;;; self.logger.debug('clearing heartbeatTimer', heartbeatTimer) 1306 heartbeatTimer = window.setTimeout(function() { 1323 try { 1324 heartbeatTimer = window.setTimeout(function() { 1307 1325 ;;; self.logger.debug('timer', testtimer, 'did it'); 1308 heartbeatTimeout(); 1309 }, Orbited.settings.HEARTBEAT_TIMEOUT); 1326 heartbeatTimeout(); 1327 }, Orbited.settings.HEARTBEAT_TIMEOUT); 1328 } 1329 catch(e) { 1330 1331 return 1332 } 1310 1333 var testtimer = heartbeatTimer; 1311 1334 … … 1772 1795 throw new Error("Already Connected") 1773 1796 } 1797 self.logger.debug('self.connect', _url) 1774 1798 url = new Orbited.URL(_url) 1775 1799 url.path += '/htmlfile' … … 1787 1811 1788 1812 var doOpen = function(_url) { 1813 ;;; self.logger.debug('doOpen', _url) 1789 1814 htmlfile = new ActiveXObject('htmlfile'); // magical microsoft object 1790 1815 htmlfile.open(); … … 2493 2518 } 2494 2519 Orbited.JSON = JSON; 2520 2495 2521 })(); -
trunk/daemon/orbited/transports/htmlfile.py
r522 r545 14 14 <html> 15 15 <head> 16 <script src="../ ../static/HTMLFileFrame.js"></script>16 <script src="../static/HTMLFileFrame.js"></script> 17 17 </head> 18 18 <body> … … 29 29 self.request.setHeader('pragma', 'no-cache') 30 30 self.request.setHeader('expires', '-1') 31 logger.debug('send initialData: ', self.initialData) 31 32 self.request.write(self.initialData) 32 33 … … 38 39 # after they are executed. 39 40 payload = '<script>e(%s)</script>' % (json.encode(packets),) 41 logger.debug('write ', payload) 40 42 self.request.write(payload); 41 43 self.totalBytes += len(payload) -
trunk/daemon/setup.py
r540 r545 22 22 setup( 23 23 name='orbited', 24 version='0. 6.2',24 version='0.7.0', 25 25 author='Michael Carter', 26 26 author_email='CarterMichael@gmail.com', … … 43 43 44 44 classifiers = [ 45 'Development Status :: 3- Beta',45 'Development Status :: 4 - Beta', 46 46 'Environment :: Console', 47 47 'Intended Audience :: Developers',