POSTed values have junk appended. Sometimes.

Harmen <[email protected]> Wed, 26 Apr 2006 10:45:31 +0200
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <20060426084531.GO12945@godel>
Hello,

I'm having some difficulty with ApacheRequest and posts. Sometimes there
are characters appended to the value of posted variables. For example
"r->param('foo')" returns "MyValue=name" in stead of "MyValue", which really is
the posted value.

It seems to be a problem with the memory managment since it happens
randomly but never on the first request, but to create a (small) testcase turns out to be difficult.

I've noticed 1 change from the original apache request 1.X sourcecode tree:
apache_request.c, in util_read:
48c48
< 	*rbuf = apr_pcalloc(r->pool, length + 1);
---
> 	*rbuf = ap_pcalloc(r->pool, length + 1);
(mod_ruby is the one with apr_pcalloc, the original has ap_pcalloc)

This patch does seems to fix my problem. Anybody any idea why the mod_ruby version
of apacherequest has it changed from ap_pcalloc to apr_pcalloc?


Thanks,
Harmen
(I'm using mod_ruby 1.2.5, apache 1.3.34, ruby 1.8.4)

-- 
                                The Moon is Waning Crescent (3% of Full)