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
85b56f12
Commit
85b56f12
authored
Dec 21, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged Dieter Maurers closeOnExec stuff from 2.2. branch
parent
469f515a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
44 additions
and
8 deletions
+44
-8
ZServer/FCGIServer.py
ZServer/FCGIServer.py
+2
-1
ZServer/FTPServer.py
ZServer/FTPServer.py
+2
-1
ZServer/HTTPServer.py
ZServer/HTTPServer.py
+2
-1
ZServer/PCGIServer.py
ZServer/PCGIServer.py
+2
-1
ZServer/__init__.py
ZServer/__init__.py
+14
-0
lib/python/ZServer/FCGIServer.py
lib/python/ZServer/FCGIServer.py
+2
-1
lib/python/ZServer/FTPServer.py
lib/python/ZServer/FTPServer.py
+2
-1
lib/python/ZServer/HTTPServer.py
lib/python/ZServer/HTTPServer.py
+2
-1
lib/python/ZServer/PCGIServer.py
lib/python/ZServer/PCGIServer.py
+2
-1
lib/python/ZServer/__init__.py
lib/python/ZServer/__init__.py
+14
-0
No files found.
ZServer/FCGIServer.py
View file @
85b56f12
...
...
@@ -103,7 +103,7 @@ from medusa import asynchat, asyncore, logger
from
medusa.counter
import
counter
from
medusa.http_server
import
compute_timezone_for_log
from
ZServer
import
CONNECTION_LIMIT
from
ZServer
import
CONNECTION_LIMIT
,
requestCloseOnExec
from
PubCore
import
handle
from
PubCore.ZEvent
import
Wakeup
...
...
@@ -347,6 +347,7 @@ class FCGIChannel(asynchat.async_chat):
self
.
server
=
server
self
.
addr
=
addr
asynchat
.
async_chat
.
__init__
(
self
,
sock
)
requestCloseOnExec
(
sock
)
self
.
setInitialState
()
self
.
remainingRecs
=
1
# We have to read at least one
self
.
env
=
{}
...
...
ZServer/FTPServer.py
View file @
85b56f12
...
...
@@ -142,7 +142,7 @@ from medusa import asyncore, asynchat, filesys
from
FTPResponse
import
make_response
from
FTPRequest
import
FTPRequest
from
ZServer
import
CONNECTION_LIMIT
from
ZServer
import
CONNECTION_LIMIT
,
requestCloseOnExec
from
cStringIO
import
StringIO
import
string
...
...
@@ -161,6 +161,7 @@ class zope_ftp_channel(ftp_channel):
def
__init__
(
self
,
server
,
conn
,
addr
,
module
):
ftp_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
requestCloseOnExec
(
conn
)
self
.
module
=
module
self
.
userid
=
''
self
.
password
=
''
...
...
ZServer/HTTPServer.py
View file @
85b56f12
...
...
@@ -123,7 +123,7 @@ from medusa.default_handler import split_path, unquote, get_header
from
medusa.asyncore
import
compact_traceback
,
dispatcher
from
ZServer
import
CONNECTION_LIMIT
,
ZOPE_VERSION
,
ZSERVER_VERSION
from
ZServer
import
requestCloseOnExec
from
zLOG
import
LOG
,
register_subsystem
,
BLATHER
,
INFO
,
WARNING
,
ERROR
import
DebugLogger
from
medusa
import
logger
...
...
@@ -327,6 +327,7 @@ class zhttp_channel(http_channel):
def
__init__
(
self
,
server
,
conn
,
addr
):
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
requestCloseOnExec
(
conn
)
self
.
queue
=
[]
self
.
working
=
0
...
...
ZServer/PCGIServer.py
View file @
85b56f12
...
...
@@ -105,7 +105,7 @@ from medusa.counter import counter
from
medusa.http_server
import
compute_timezone_for_log
from
medusa.asyncore
import
compact_traceback
from
ZServer
import
CONNECTION_LIMIT
from
ZServer
import
CONNECTION_LIMIT
,
requestCloseOnExec
from
PubCore
import
handle
from
PubCore.ZEvent
import
Wakeup
...
...
@@ -132,6 +132,7 @@ class PCGIChannel(asynchat.async_chat):
self
.
server
=
server
self
.
addr
=
addr
asynchat
.
async_chat
.
__init__
(
self
,
sock
)
requestCloseOnExec
(
sock
)
self
.
env
=
{}
self
.
data
=
StringIO
()
self
.
set_terminator
(
10
)
...
...
ZServer/__init__.py
View file @
85b56f12
...
...
@@ -119,6 +119,20 @@ try:
except
:
pass
# A routine to try to arrange for request sockets to be closed
# on exec. This makes it easier for folks who spawn long running
# processes from Zope code. Thanks to Dieter Maurer for this.
try
:
import
fcntl
,
FCNTL
FCNTL
.
F_SETFD
;
FCNTL
.
FD_CLOEXEC
def
requestCloseOnExec
(
sock
):
fcntl
.
fcntl
(
sock
.
fileno
(),
FCNTL
.
F_SETFD
,
FCNTL
.
FD_CLOEXEC
)
except
(
ImportError
,
AttributeError
):
def
requestCloseOnExec
(
sock
):
pass
from
medusa
import
resolver
,
logger
,
asyncore
from
HTTPServer
import
zhttp_server
,
zhttp_handler
from
PCGIServer
import
PCGIServer
...
...
lib/python/ZServer/FCGIServer.py
View file @
85b56f12
...
...
@@ -103,7 +103,7 @@ from medusa import asynchat, asyncore, logger
from
medusa.counter
import
counter
from
medusa.http_server
import
compute_timezone_for_log
from
ZServer
import
CONNECTION_LIMIT
from
ZServer
import
CONNECTION_LIMIT
,
requestCloseOnExec
from
PubCore
import
handle
from
PubCore.ZEvent
import
Wakeup
...
...
@@ -347,6 +347,7 @@ class FCGIChannel(asynchat.async_chat):
self
.
server
=
server
self
.
addr
=
addr
asynchat
.
async_chat
.
__init__
(
self
,
sock
)
requestCloseOnExec
(
sock
)
self
.
setInitialState
()
self
.
remainingRecs
=
1
# We have to read at least one
self
.
env
=
{}
...
...
lib/python/ZServer/FTPServer.py
View file @
85b56f12
...
...
@@ -142,7 +142,7 @@ from medusa import asyncore, asynchat, filesys
from
FTPResponse
import
make_response
from
FTPRequest
import
FTPRequest
from
ZServer
import
CONNECTION_LIMIT
from
ZServer
import
CONNECTION_LIMIT
,
requestCloseOnExec
from
cStringIO
import
StringIO
import
string
...
...
@@ -161,6 +161,7 @@ class zope_ftp_channel(ftp_channel):
def
__init__
(
self
,
server
,
conn
,
addr
,
module
):
ftp_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
requestCloseOnExec
(
conn
)
self
.
module
=
module
self
.
userid
=
''
self
.
password
=
''
...
...
lib/python/ZServer/HTTPServer.py
View file @
85b56f12
...
...
@@ -123,7 +123,7 @@ from medusa.default_handler import split_path, unquote, get_header
from
medusa.asyncore
import
compact_traceback
,
dispatcher
from
ZServer
import
CONNECTION_LIMIT
,
ZOPE_VERSION
,
ZSERVER_VERSION
from
ZServer
import
requestCloseOnExec
from
zLOG
import
LOG
,
register_subsystem
,
BLATHER
,
INFO
,
WARNING
,
ERROR
import
DebugLogger
from
medusa
import
logger
...
...
@@ -327,6 +327,7 @@ class zhttp_channel(http_channel):
def
__init__
(
self
,
server
,
conn
,
addr
):
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
requestCloseOnExec
(
conn
)
self
.
queue
=
[]
self
.
working
=
0
...
...
lib/python/ZServer/PCGIServer.py
View file @
85b56f12
...
...
@@ -105,7 +105,7 @@ from medusa.counter import counter
from
medusa.http_server
import
compute_timezone_for_log
from
medusa.asyncore
import
compact_traceback
from
ZServer
import
CONNECTION_LIMIT
from
ZServer
import
CONNECTION_LIMIT
,
requestCloseOnExec
from
PubCore
import
handle
from
PubCore.ZEvent
import
Wakeup
...
...
@@ -132,6 +132,7 @@ class PCGIChannel(asynchat.async_chat):
self
.
server
=
server
self
.
addr
=
addr
asynchat
.
async_chat
.
__init__
(
self
,
sock
)
requestCloseOnExec
(
sock
)
self
.
env
=
{}
self
.
data
=
StringIO
()
self
.
set_terminator
(
10
)
...
...
lib/python/ZServer/__init__.py
View file @
85b56f12
...
...
@@ -119,6 +119,20 @@ try:
except
:
pass
# A routine to try to arrange for request sockets to be closed
# on exec. This makes it easier for folks who spawn long running
# processes from Zope code. Thanks to Dieter Maurer for this.
try
:
import
fcntl
,
FCNTL
FCNTL
.
F_SETFD
;
FCNTL
.
FD_CLOEXEC
def
requestCloseOnExec
(
sock
):
fcntl
.
fcntl
(
sock
.
fileno
(),
FCNTL
.
F_SETFD
,
FCNTL
.
FD_CLOEXEC
)
except
(
ImportError
,
AttributeError
):
def
requestCloseOnExec
(
sock
):
pass
from
medusa
import
resolver
,
logger
,
asyncore
from
HTTPServer
import
zhttp_server
,
zhttp_handler
from
PCGIServer
import
PCGIServer
...
...
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