version 0.2.8, Namecoin domains using internal resolver site, --disable_zeromq option to skip backward compatiblity layer and save some memory, connectionserver firstchar error fixes, missing unpacker crash fix, sitemanager class to allow extensions, add loaded plugin list to websocket api, faster content publishing, mark updating file as bad, remove coppersurfer tracker add eddie4, internal server error with error displaying, allow site domains in UiRequest, better progress bar, wait for siteinfo before before using localstorage, csslater hide only if opacity is 0
This commit is contained in:
parent
78f97dcbe8
commit
b122f47100
26 changed files with 673 additions and 124 deletions
|
@ -3,10 +3,14 @@ from cStringIO import StringIO
|
|||
import gevent, msgpack
|
||||
from Config import config
|
||||
from Debug import Debug
|
||||
try:
|
||||
import zmq.green as zmq
|
||||
except:
|
||||
zmq = None
|
||||
zmq = None
|
||||
if not config.disable_zeromq:
|
||||
try:
|
||||
import zmq.green as zmq
|
||||
except:
|
||||
zmq = None
|
||||
|
||||
|
||||
|
||||
class Connection:
|
||||
def __init__(self, server, ip, port, sock=None):
|
||||
|
@ -75,7 +79,8 @@ class Connection:
|
|||
try:
|
||||
firstchar = sock.recv(1) # Find out if pure socket or zeromq
|
||||
except Exception, err:
|
||||
self.log.debug("Socket firstchar error: %s" % Debug.formatException(err))
|
||||
if self.log:
|
||||
self.log.debug("Socket firstchar error: %s" % Debug.formatException(err))
|
||||
self.close()
|
||||
return False
|
||||
if firstchar == "\xff": # Backward compatiblity: forward data to zmq
|
||||
|
@ -106,7 +111,7 @@ class Connection:
|
|||
try:
|
||||
if not firstchar: firstchar = sock.recv(1)
|
||||
except Exception, err:
|
||||
self.log.debug("Socket firstchar error: %s" % Debug.formatException(err))
|
||||
if self.log: self.log.debug("Socket firstchar error: %s" % Debug.formatException(err))
|
||||
self.close()
|
||||
return False
|
||||
if firstchar == "\xff": # Backward compatibility to zmq
|
||||
|
@ -294,3 +299,4 @@ class Connection:
|
|||
del self.log
|
||||
del self.unpacker
|
||||
del self.sock
|
||||
self.unpacker = None
|
||||
|
|
|
@ -26,7 +26,7 @@ class ConnectionServer:
|
|||
self.zmq_last_connection = None # Last incoming message client
|
||||
|
||||
self.peer_id = "-ZN0"+config.version.replace(".", "")+"-"+''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(12)) # Bittorrent style peerid
|
||||
|
||||
|
||||
if port: # Listen server on a port
|
||||
self.zmq_port = port-1
|
||||
self.pool = Pool(1000) # do not accept more than 1000 connections
|
||||
|
@ -144,6 +144,9 @@ class ConnectionServer:
|
|||
|
||||
|
||||
def zmqServer(self):
|
||||
if config.disable_zeromq:
|
||||
self.log.debug("ZeroMQ disabled by config")
|
||||
return False
|
||||
self.log.debug("Starting ZeroMQ on: tcp://127.0.0.1:%s..." % self.zmq_port)
|
||||
try:
|
||||
import zmq.green as zmq
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue