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
cfbce411
Commit
cfbce411
authored
Oct 04, 2002
by
Brian Lloyd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix for collector # 606
parent
deb66d0f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
ZServer/HTTPServer.py
ZServer/HTTPServer.py
+12
-0
lib/python/ZServer/HTTPServer.py
lib/python/ZServer/HTTPServer.py
+12
-0
No files found.
ZServer/HTTPServer.py
View file @
cfbce411
...
@@ -283,6 +283,7 @@ class zhttp_channel(http_channel):
...
@@ -283,6 +283,7 @@ class zhttp_channel(http_channel):
closed
=
0
closed
=
0
zombie_timeout
=
100
*
60
# 100 minutes
zombie_timeout
=
100
*
60
# 100 minutes
max_header_len
=
8196
def
__init__
(
self
,
server
,
conn
,
addr
):
def
__init__
(
self
,
server
,
conn
,
addr
):
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
...
@@ -336,6 +337,17 @@ class zhttp_channel(http_channel):
...
@@ -336,6 +337,17 @@ class zhttp_channel(http_channel):
if
(
now
-
channel
.
creation_time
)
>
channel
.
zombie_timeout
:
if
(
now
-
channel
.
creation_time
)
>
channel
.
zombie_timeout
:
channel
.
close
()
channel
.
close
()
def
collect_incoming_data
(
self
,
data
):
# Override medusa http_channel implementation to prevent DOS attacks
# that send never-ending HTTP headers.
if
self
.
current_request
:
# we are receiving data (probably POST data) for a request
self
.
current_request
.
collect_incoming_data
(
data
)
else
:
# we are receiving header (request) data
self
.
in_buffer
=
self
.
in_buffer
+
data
if
len
(
self
.
in_buffer
)
>
self
.
max_header_len
:
raise
ValueError
(
'HTTP headers invalid (too long)'
)
class
zhttp_server
(
http_server
):
class
zhttp_server
(
http_server
):
"http server"
"http server"
...
...
lib/python/ZServer/HTTPServer.py
View file @
cfbce411
...
@@ -283,6 +283,7 @@ class zhttp_channel(http_channel):
...
@@ -283,6 +283,7 @@ class zhttp_channel(http_channel):
closed
=
0
closed
=
0
zombie_timeout
=
100
*
60
# 100 minutes
zombie_timeout
=
100
*
60
# 100 minutes
max_header_len
=
8196
def
__init__
(
self
,
server
,
conn
,
addr
):
def
__init__
(
self
,
server
,
conn
,
addr
):
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
...
@@ -336,6 +337,17 @@ class zhttp_channel(http_channel):
...
@@ -336,6 +337,17 @@ class zhttp_channel(http_channel):
if
(
now
-
channel
.
creation_time
)
>
channel
.
zombie_timeout
:
if
(
now
-
channel
.
creation_time
)
>
channel
.
zombie_timeout
:
channel
.
close
()
channel
.
close
()
def
collect_incoming_data
(
self
,
data
):
# Override medusa http_channel implementation to prevent DOS attacks
# that send never-ending HTTP headers.
if
self
.
current_request
:
# we are receiving data (probably POST data) for a request
self
.
current_request
.
collect_incoming_data
(
data
)
else
:
# we are receiving header (request) data
self
.
in_buffer
=
self
.
in_buffer
+
data
if
len
(
self
.
in_buffer
)
>
self
.
max_header_len
:
raise
ValueError
(
'HTTP headers invalid (too long)'
)
class
zhttp_server
(
http_server
):
class
zhttp_server
(
http_server
):
"http server"
"http server"
...
...
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