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
6a5dfc32
Commit
6a5dfc32
authored
Oct 10, 2008
by
Sidnei da Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Temporary workaround for new asyncore in Python 2.6. Need to clean this up
parent
4913d686
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
21 deletions
+26
-21
lib/python/ZServer/HTTPServer.py
lib/python/ZServer/HTTPServer.py
+7
-2
lib/python/ZServer/medusa/http_server.py
lib/python/ZServer/medusa/http_server.py
+19
-19
No files found.
lib/python/ZServer/HTTPServer.py
View file @
6a5dfc32
...
...
@@ -45,7 +45,8 @@ from HTTPResponse import make_response
from
ZPublisher.HTTPRequest
import
HTTPRequest
from
App.config
import
getConfiguration
from
medusa.http_server
import
http_server
,
get_header
,
http_channel
,
VERSION_STRING
from
medusa.http_server
import
http_server
,
get_header
from
medusa.http_server
import
fifo
,
http_channel
,
VERSION_STRING
import
asyncore
from
medusa
import
counter
,
producers
from
medusa.test
import
max_sockets
...
...
@@ -334,6 +335,10 @@ class zhttp_channel(http_channel):
def
__init__
(
self
,
server
,
conn
,
addr
):
http_channel
.
__init__
(
self
,
server
,
conn
,
addr
)
if
isinstance
(
self
.
producer_fifo
,
fifo
):
self
.
producer_fifo_push
=
self
.
producer_fifo
.
push
else
:
self
.
producer_fifo_push
=
self
.
producer_fifo
.
append
requestCloseOnExec
(
conn
)
self
.
queue
=
[]
self
.
working
=
0
...
...
@@ -345,7 +350,7 @@ class zhttp_channel(http_channel):
# producers by default
if
self
.
closed
:
return
self
.
producer_fifo
.
push
(
producer
)
self
.
producer_fifo
_
push
(
producer
)
if
send
:
self
.
initiate_send
()
push_with_producer
=
push
...
...
lib/python/ZServer/medusa/http_server.py
View file @
6a5dfc32
...
...
@@ -528,25 +528,25 @@ class http_channel (asynchat.async_chat):
# no handlers, so complain
r
.
error
(
404
)
def
writable
(
self
):
# this is just the normal async_chat 'writable', here for comparison
return
self
.
ac_out_buffer
or
len
(
self
.
producer_fifo
)
def
writable_for_proxy
(
self
):
# this version of writable supports the idea of a 'stalled' producer
# [i.e., it's not ready to produce any output yet] This is needed by
# the proxy, which will be waiting for the magic combination of
# 1) hostname resolved
# 2) connection made
# 3) data available.
if
self
.
ac_out_buffer
:
return
1
elif
len
(
self
.
producer_fifo
):
p
=
self
.
producer_fifo
.
first
()
if
hasattr
(
p
,
'stalled'
):
return
not
p
.
stalled
()
else
:
return
1
#
def writable (self):
#
# this is just the normal async_chat 'writable', here for comparison
#
return self.ac_out_buffer or len(self.producer_fifo)
#
def writable_for_proxy (self):
#
# this version of writable supports the idea of a 'stalled' producer
#
# [i.e., it's not ready to produce any output yet] This is needed by
#
# the proxy, which will be waiting for the magic combination of
#
# 1) hostname resolved
#
# 2) connection made
#
# 3) data available.
#
if self.ac_out_buffer:
#
return 1
#
elif len(self.producer_fifo):
#
p = self.producer_fifo.first()
#
if hasattr (p, 'stalled'):
#
return not p.stalled()
#
else:
#
return 1
# ===========================================================================
# HTTP Server Object
...
...
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