]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_dht/HTTPServer.py
Fixed the ThrottlingFactory to work with web2 static streams from the web server.
[quix0rs-apt-p2p.git] / apt_dht / HTTPServer.py
index 4d62e5b0ee4602a88ba58a0b2c650c3aca03cd55..5c6904f764c9b016c357e7bca7d9ca2918f886f6 100644 (file)
@@ -43,7 +43,7 @@ class FileDownloader(static.File):
         
 class FileUploaderStream(stream.FileStream):
 
-    CHUNK_SIZE = 16*1024
+    CHUNK_SIZE = 4*1024
     
     def read(self, sendfile=False):
         if self.f is None:
@@ -123,7 +123,7 @@ class TopLevel(resource.Resource):
 #            serverFilter.buckets[None] = serverBucket
 #
 #            self.factory.protocol = htb.ShapedProtocolFactory(self.factory.protocol, serverFilter)
-            self.factory = ThrottlingFactory(self.factory, writeLimit = 3*1024)
+            self.factory = ThrottlingFactory(self.factory, writeLimit = 30*1024)
         return self.factory
 
     def render(self, ctx):
@@ -172,7 +172,7 @@ if __name__ == '__builtin__':
     
     class DB:
         def lookupHash(self, hash):
-            return [{'path': FilePath(os.path.expanduser('~/.xsession-errors'))}]
+            return [{'path': FilePath(os.path.expanduser('~/school/optout'))}]
     
     t = TopLevel(FilePath(os.path.expanduser('~')), DB(), None)
     factory = t.getHTTPFactory()