Permalink
Browse files

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

…7f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 9487ad3 commit 7422ab7bf6f0a7af0dc0ec00a721fce6d5a29699 @alobbs alobbs committed Jan 16, 2009
Showing with 8 additions and 7 deletions.
  1. +3 −0 ChangeLog
  2. +5 −7 contrib/bin2buffer.py
View
@@ -1,5 +1,8 @@
2009-01-16 Alvaro Lopez Ortega <alvaro@octality.com>
+ * contrib/bin2buffer.py: Call cherokee_buffer_ensure_size() in
+ order to avoid memory reallocations.
+
* cherokee/connection.c (cherokee_connection_build_header),
cherokee/http.h: Rework the 304 issue. It was adding the chunked
connection header in replies with no body.
View
@@ -1,15 +1,13 @@
-import sys, string
-
-def is_letter(x):
- if ord(x) in range(71, 91) or ord(x) in range(103, 123):
- return True
- return False
-
+import os, sys, string
def print_block(info, len):
print 'ret = cherokee_buffer_add (buffer, \\\n' + info + ', ' + str(len) + ');'
print 'if (ret < ret_ok) return ret;\n'
+
+print 'ret = cherokee_buffer_ensure_size (buffer, %d);' % (os.path.getsize(sys.argv[1]))
+print 'if (ret < ret_ok) return ret;\n'
+
file = open (sys.argv[1], "r")
cont = file.read()
file.close()

0 comments on commit 7422ab7

Please sign in to comment.