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
0bd4df83
Commit
0bd4df83
authored
Jul 23, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid ZServer depending on App.
parent
b33bf1df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
src/ZServer/HTTPServer.py
src/ZServer/HTTPServer.py
+12
-2
src/ZServer/utils.py
src/ZServer/utils.py
+18
-2
No files found.
src/ZServer/HTTPServer.py
View file @
0bd4df83
...
...
@@ -43,7 +43,6 @@ from cStringIO import StringIO
from
PubCore
import
handle
from
HTTPResponse
import
make_response
from
ZPublisher.HTTPRequest
import
HTTPRequest
from
App.config
import
getConfiguration
import
asyncore
import
asynchat
...
...
@@ -76,6 +75,17 @@ header2env={'content-length' : 'CONTENT_LENGTH',
}
def
get_http_header_max_length
():
max_length
=
8192
try
:
from
App.config
import
getConfiguration
except
ImportError
:
pass
else
:
max_length
=
getConfiguration
().
http_header_max_length
return
max_length
class
zhttp_collector
:
def
__init__
(
self
,
handler
,
request
,
size
):
from
ZServer
import
LARGE_FILE_THRESHOLD
...
...
@@ -352,7 +362,7 @@ class zhttp_channel(http_channel):
requestCloseOnExec
(
conn
)
self
.
queue
=
[]
self
.
working
=
0
self
.
max_header_len
=
get
Configuration
().
http_header_max_length
self
.
max_header_len
=
get
_http_header_max_length
()
def
push
(
self
,
producer
,
send
=
1
):
# this is thread-safe when send is false
...
...
src/ZServer/utils.py
View file @
0bd4df83
...
...
@@ -13,10 +13,26 @@
""" A set of utility routines used by asyncore initialization """
import
sys
import
pkg_resources
_version_string
=
None
def
_prep_version_data
():
global
_version_string
if
_version_string
is
None
:
v
=
sys
.
version_info
pyver
=
"python %d.%d.%d, %s"
%
(
v
[
0
],
v
[
1
],
v
[
2
],
sys
.
platform
)
dist
=
pkg_resources
.
get_distribution
(
'Zope2'
)
_version_string
=
"%s, %s"
%
(
dist
.
version
,
pyver
)
def
getZopeVersion
():
import
App.version_txt
return
App
.
version_txt
.
version_txt
()
_prep_version_data
()
return
'(%s)'
%
_version_string
def
patchAsyncoreLogger
():
# Poke the Python logging module into asyncore to send messages to logging
...
...
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