X-Git-Url: https://git.mxchange.org/?p=quix0rs-apt-p2p.git;a=blobdiff_plain;f=apt-dht.py;h=b096d383cd831927f39202de7fca3647aa99121e;hp=e5288b0a77b7be3731b101dbe572e5f14e1beb63;hb=247964bfec76a3cd6475c708b003affa8bc15118;hpb=d1d2930c9ecfd68235c4d8d853546180ed4889f4 diff --git a/apt-dht.py b/apt-dht.py index e5288b0..b096d38 100644 --- a/apt-dht.py +++ b/apt-dht.py @@ -16,7 +16,7 @@ from twisted.internet import reactor from twisted.python import usage, log from twisted.web2 import channel -from apt_dht.apt_dht_conf import config, version +from apt_dht.apt_dht_conf import config, version, DEFAULT_CONFIG_FILES from apt_dht.interfaces import IDHT config_file = [] @@ -51,7 +51,7 @@ if __name__ == '__main__': f = open(log_file, 'w') log.startLogging(f, setStdout=1) -config.read(config_file) +config.read(DEFAULT_CONFIG_FILES + [config_file]) if config.has_option('DEFAULT', 'username') and config.get('DEFAULT', 'username'): uid,gid = pwd.getpwnam(config.get('DEFAULT', 'username'))[2:4] else: @@ -71,8 +71,8 @@ if not config.getboolean('DEFAULT', 'DHT-only'): log.msg('Starting main application server') from apt_dht.apt_dht import AptDHT myapp = AptDHT(myDHT) - site = myapp.getSite() - s = strports.service('tcp:'+config.get('DEFAULT', 'port'), channel.HTTPFactory(site)) + factory = myapp.getHTTPFactory() + s = strports.service('tcp:'+config.get('DEFAULT', 'port'), factory) s.setServiceParent(application) else: myDHT.loadConfig(config, config.get('DEFAULT', 'DHT'))