Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
12f0321c
Commit
12f0321c
authored
Aug 29, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merging ajung-fast-listen branch
parent
778ad970
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
3 deletions
+43
-3
doc/CHANGES.txt
doc/CHANGES.txt
+5
-0
lib/python/ZServer/HTTPServer.py
lib/python/ZServer/HTTPServer.py
+10
-3
lib/python/ZServer/component.xml
lib/python/ZServer/component.xml
+6
-0
lib/python/ZServer/datatypes.py
lib/python/ZServer/datatypes.py
+2
-0
lib/python/Zope2/Startup/__init__.py
lib/python/Zope2/Startup/__init__.py
+13
-0
skel/etc/zope.conf.in
skel/etc/zope.conf.in
+7
-0
No files found.
doc/CHANGES.txt
View file @
12f0321c
...
...
@@ -27,6 +27,11 @@ Zope Changes
Features added
- added 'fast_listen' directive to http-server and webdav-source-server
sections in etc/zope.conf in order to defer the opening of the sockets
until the late startup phase. This in in particular useful when running
Zope behind a loadbalancer (patch by Patrick Gerken).
Bugs Fixed
- Collector #2155: Fix wrong parameter being passed to
...
...
lib/python/ZServer/HTTPServer.py
View file @
12f0321c
...
...
@@ -428,8 +428,10 @@ class zhttp_server(http_server):
channel_class
=
zhttp_channel
shutup
=
0
def
__init__
(
self
,
ip
,
port
,
resolver
=
None
,
logger_object
=
None
):
def
__init__
(
self
,
ip
,
port
,
resolver
=
None
,
logger_object
=
None
,
fast_listen
=
True
):
self
.
shutup
=
1
self
.
fast_listen
=
fast_listen
http_server
.
__init__
(
self
,
ip
,
port
,
resolver
,
logger_object
)
self
.
shutup
=
0
self
.
log_info
(
'%s server started at %s
\
n
'
...
...
@@ -460,8 +462,13 @@ class zhttp_server(http_server):
def
listen
(
self
,
num
):
# override asyncore limits for nt's listen queue size
self
.
accepting
=
1
return
self
.
socket
.
listen
(
num
)
if
self
.
fast_listen
:
self
.
accepting
=
1
return
self
.
socket
.
listen
(
num
)
else
:
return
0
class
zwebdav_server
(
zhttp_server
):
server_protocol
=
'WebDAV'
lib/python/ZServer/component.xml
View file @
12f0321c
...
...
@@ -19,6 +19,12 @@
receive WebDAV source responses to GET requests.
</description>
</key>
<key
name=
"fast_listen"
datatype=
"boolean"
default=
"on"
>
<description>
Defines wether the http server should listen to requests immediatelly
or only after zope is ready to run
</description>
</key>
<key
name=
"use-wsgi"
datatype=
"boolean"
default=
"off"
/>
</sectiontype>
...
...
lib/python/ZServer/datatypes.py
View file @
12f0321c
...
...
@@ -70,6 +70,7 @@ class HTTPServerFactory(ServerFactory):
self
.
force_connection_close
=
section
.
force_connection_close
# webdav-source-server sections won't have webdav_source_clients:
webdav_clients
=
getattr
(
section
,
"webdav_source_clients"
,
None
)
self
.
fast_listen
=
getattr
(
section
,
'fast_listen'
)
self
.
webdav_source_clients
=
webdav_clients
self
.
use_wsgi
=
section
.
use_wsgi
...
...
@@ -81,6 +82,7 @@ class HTTPServerFactory(ServerFactory):
handler
.
set_webdav_source_clients
(
self
.
webdav_source_clients
)
server
=
self
.
server_class
(
ip
=
self
.
ip
,
port
=
self
.
port
,
resolver
=
self
.
dnsresolver
,
fast_listen
=
self
.
fast_listen
,
logger_object
=
access_logger
)
server
.
install_handler
(
handler
)
return
server
...
...
lib/python/Zope2/Startup/__init__.py
View file @
12f0321c
...
...
@@ -100,6 +100,7 @@ class ZopeStarter:
self
.
makePidFile
()
self
.
setupInterpreter
()
self
.
startZope
()
self
.
serverListen
()
from
App.config
import
getConfiguration
config
=
getConfiguration
()
if
not
config
.
twisted_servers
:
...
...
@@ -211,6 +212,18 @@ class ZopeStarter:
ZServer
.
setNumberOfThreads
(
self
.
cfg
.
zserver_threads
)
ZServer
.
CONNECTION_LIMIT
=
self
.
cfg
.
max_listen_sockets
def
serverListen
(
self
):
for
server
in
self
.
cfg
.
servers
:
if
hasattr
(
server
,
'fast_listen'
):
# This one has the delayed listening feature
if
not
server
.
fast_listen
:
server
.
fast_listen
=
True
server
.
listen
(
1024
)
# same value as defined in medusa.http_server.py
def
setupServers
(
self
):
socket_err
=
(
'There was a problem starting a server of type "%s". '
...
...
skel/etc/zope.conf.in
View file @
12f0321c
...
...
@@ -903,9 +903,16 @@ instancehome $INSTANCE
<http-server>
# valid keys are "address" and "force-connection-close"
address 8080
# force-connection-close on
#
# You can also use the WSGI interface between ZServer and ZPublisher:
# use-wsgi on
#
# To defer the opening of the HTTP socket until the end of the
# startup phase:
# fast_listen false
#
</http-server>
# Examples:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment