Commit 7c877db7 authored by Sidnei da Silva's avatar Sidnei da Silva

Move import inside methods so that the ZConfig overrides actually takes effect.

parent 2af37666
......@@ -32,7 +32,7 @@ from medusa import logger
from medusa.counter import counter
from medusa.http_server import compute_timezone_for_log
from ZServer import CONNECTION_LIMIT, requestCloseOnExec
from ZServer import requestCloseOnExec
from PubCore import handle
from PubCore.ZEvent import Wakeup
......@@ -642,6 +642,7 @@ class FCGIServer(asyncore.dispatcher):
def readable(self):
from ZServer import CONNECTION_LIMIT
return len(asyncore.socket_map) < CONNECTION_LIMIT
......
......@@ -72,7 +72,7 @@ from medusa import filesys
from FTPResponse import make_response
from FTPRequest import FTPRequest
from ZServer import CONNECTION_LIMIT, requestCloseOnExec
from ZServer import requestCloseOnExec
from cStringIO import StringIO
import os
......@@ -653,6 +653,7 @@ class FTPServer(ftp_server):
self.ftp_channel_class (self, conn, addr, self.module)
def readable(self):
from ZServer import CONNECTION_LIMIT
return len(asyncore.socket_map) < CONNECTION_LIMIT
def listen(self, num):
......
......@@ -52,8 +52,8 @@ from medusa.test import max_sockets
from medusa.default_handler import unquote
from asyncore import compact_traceback, dispatcher
from ZServer import CONNECTION_LIMIT, ZOPE_VERSION, ZSERVER_VERSION
from ZServer import requestCloseOnExec, LARGE_FILE_THRESHOLD
from ZServer import ZOPE_VERSION, ZSERVER_VERSION
from ZServer import requestCloseOnExec
from zLOG import LOG, register_subsystem, BLATHER, INFO, WARNING, ERROR
import DebugLogger
from medusa import logger
......@@ -74,6 +74,7 @@ header2env={'content-length' : 'CONTENT_LENGTH',
class zhttp_collector:
def __init__(self, handler, request, size):
from ZServer import LARGE_FILE_THRESHOLD
self.handler = handler
self.request = request
if size > LARGE_FILE_THRESHOLD:
......@@ -407,8 +408,9 @@ class zhttp_server(http_server):
requestCloseOnExec(self.socket)
def readable(self):
from ZServer import CONNECTION_LIMIT
return self.accepting and \
len(asyncore.socket_map) < CONNECTION_LIMIT
len(asyncore.socket_map) < CONNECTION_LIMIT
def listen(self, num):
# override asyncore limits for nt's listen queue size
......
......@@ -35,7 +35,7 @@ from medusa.http_server import compute_timezone_for_log
from asyncore import compact_traceback
import ZServer
from ZServer import CONNECTION_LIMIT, requestCloseOnExec
from ZServer import requestCloseOnExec
from PubCore import handle
from PubCore.ZEvent import Wakeup
......@@ -327,6 +327,7 @@ class PCGIServer(asyncore.dispatcher):
self.channel_class(self, conn, addr)
def readable(self):
from ZServer import CONNECTION_LIMIT
return len(asyncore.socket_map) < CONNECTION_LIMIT
def writable (self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment