Permalink
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@1326 5dc97367-9…

…7f1-0310-9951-d761b3857238
  • Loading branch information...
alobbs committed Mar 23, 2008
1 parent be1b01e commit 3ff23417020ebe095da5c24402e084527dcda642
Showing with 24 additions and 6 deletions.
  1. +3 −0 ChangeLog
  2. +13 −1 admin/pyscgi.py
  3. +7 −4 admin/server.py
  4. +1 −1 cherokee.conf.sample.pre
View
@@ -1,5 +1,8 @@
2008-03-23 Alvaro Lopez Ortega <alvaro@alobbs.com>
+ * admin/pyscgi.py: Updated to pyscgi 1.6. It fixes a writing issue
+ on OS X.
+
* Makefile.am, mime.types.sample, mime.compression.types.sample:
Example mime type files have been removed. They are no longer
needed.
View
@@ -41,7 +41,7 @@
import errno
import sys
-__version__ = '1.5'
+__version__ = '1.6'
__author__ = 'Alvaro Lopez Ortega'
@@ -62,6 +62,18 @@ def __safe_read (self, lenght):
continue
raise
+ def send(self, buf):
+ pending = len(buf)
+ offset = 0
+ while pending:
+ try:
+ sent = self.connection.send(buf[offset:])
+ pending -= sent
+ offset += sent
+ except socket.error, e:
+ if e[0]!=errno.EAGAIN:
+ raise
+
def __read_netstring_size (self):
size = ""
while 1:
View
@@ -8,6 +8,7 @@
import pyscgi
import thread
import signal
+import socket
# Application modules
#
@@ -61,8 +62,8 @@ def handle_request (self):
page = PageError (cfg, PageError.ICONS_DIR_MISSING)
if page:
- self.wfile.write ('Status: 200 OK\r\n\r\n' +
- page.HandleRequest (uri, Post()))
+ self.send ('Status: 200 OK\r\n\r\n' +
+ page.HandleRequest (uri, Post()))
return
# Check the URL
@@ -131,8 +132,10 @@ def handle_request (self):
headers += "Location: %s\r\n" % (body)
# Send result
- self.wfile.write('Status: %s\r\n' % (status) +
- headers + '\r\n' + body)
+ content = 'Status: %s\r\n' % (status) + \
+ headers + '\r\n' + body
+
+ return self.send (content)
# Server
View
@@ -229,7 +229,7 @@ mime!application/x-tcl!extensions = tcl
mime!application/x-tex-gf!extensions = gf
mime!application/x-tex-pk!extensions = pk
mime!application/x-texinfo!extensions = texinfo,texi
-mime!application/x-trash!extensions = ~,%,bak,old,sik
+mime!application/x-trash!extensions = ~,bak,old,sik
mime!application/x-troff!extensions = t,tr,roff
mime!application/x-troff-man!extensions = man
mime!application/x-troff-me!extensions = me

0 comments on commit 3ff2341

Please sign in to comment.