mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-06 Thread Alexis Marrero
All, The current 3.1 mod_python implementation of mod_python.util.StorageField.read_to_boudary reads as follows:   203      def read_to_boundary(self, req, boundary, file):   204          delim = ""   205          line = req.readline()   206          sline = line.strip()   207          last_bound =

Re: mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-06 Thread Alexis Marrero
;) f.seek(0) o = file('test.bin', 'wb') read_to_boundary(None, f, '--myboundary', o) o.close() /amn On Nov 6, 2005, at 11:58 AM, Jim Gallacher wrote: Alexis, I wanted to add that I'm testing your code. Alexis Marrero wrote: Let me know any comments on it and if

Re: mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-06 Thread Alexis Marrero
the server is correct. I could not reproduce Alexis' bug report this way, however. But I then I added a test with the UNIX-HATERS handbook file ugh.pdf, and bang, here comes the bug. I've checked in both unit tests into subversion, so that you can play with them. I'm now going to t

Re: mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-07 Thread Alexis Marrero
Sorry for all this emails, but my system depends 100% on mod_python specially file uploading. :) On Nov 7, 2005, at 2:04 PM, Jim Gallacher wrote: Alexis Marrero wrote: Jim, Nicolas, Thanks for sending the function that creates the test file. However I ran it to create the test file, and

Re: mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-07 Thread Alexis Marrero
(outputtestfile.bin) = d481990a0f0bbd8acf847cd732714555 I'm running a test with my set of files (6+) to see any other new issues. On Nov 7, 2005, at 6:35 PM, Jim Gallacher wrote: Alexis Marrero wrote: Ok. Now I'm confused. So am I! I've created a test harness s

Re: mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-08 Thread Alexis Marrero
Thanks for that improvement, don't like its complexity though. I'm testing "mikes" version with my set of files I will all let you know how it goes. BTW, the line that reads "last_bound = boundary + '--'" so we save 4 CPU cycles there :) The next test that I will run this against will be

Re: mod_python.util.StorageField.read_to_boundary has problems in 3.1 and 3.2

2005-11-08 Thread Alexis Marrero
Inspired by Mike's changes I made some changes the "new" version to improve performance while keeping readability: def read_to_boundary_new(self, req, boundary, file, readBlockSize): previous_delimiter = '' bound_length = len(boundary) while 1: line = req.readline(readBlockS

memory leak in request.readline()

2006-08-10 Thread Alexis Marrero
All, We are trying to nail down a memory leak that happens only when documents are POSTed to the server. For testing we have a short script that does: while True: dictionary_of_parameters = {'field1': 'a'*10} post('url...', dictionary_of_parameters) Then we run "top" on

Re: memory leak in request.readline()

2006-08-11 Thread Alexis Marrero
is that we are returning results, line 781 (original file), as the last time that we will ever read from buffer without deallocating the buffer memory. Even with this fix, which I'm not 100% sure that is a fix, memory still leaking but in a lower rate. Any help will be greatly appreciated

Re: memory leak in request.readline()

2006-08-14 Thread Alexis Marrero
Graham, In http://svn.apache.org/viewvc/httpd/mod_python/trunk/src/ requestobject.c?view=markup&pathrev=431327, in req_readlines(): /* is there anything left in the rbuff from previous reads? */ if (self->rbuff_pos < self->rbuff_len) { /* if yes, process that first */ wh

Re: [jira] Created: (MODPYTHON-184) Memory leak apache.table()

2006-08-15 Thread Alexis Marrero
Jim,This are my results for the memory leak search in apache.table().  The table object creates a memory pool by using apr_pool_create_ex() and destroys the pool using apr_pool_destroy(). I added a line in MpTable_New() before "return (PyObject*)t" to destroy the pool and ran 1M iterations and I no

[jira] Commented: (MODPYTHON-184) Memory leak apache.table()

2006-11-06 Thread Alexis Marrero (JIRA)
[ http://issues.apache.org/jira/browse/MODPYTHON-184?page=comments#action_12447665 ] Alexis Marrero commented on MODPYTHON-184: -- [[ Old comment, sent by email on Tue, 15 Aug 2006 15:54:50 -0400 ]] Jim, This are my results for the