Date: 2009-04-23 15:40
Sender: Ruslan Kyrychuk
Have similar situation.
Passenger 2.1.2, ruby 1.8.6 (2008-08-08) SUSE 32bit
My steps are following:
1. Upload file to server.
2. Copy to temp folder with changing extension.
3. Creating http post with references to file
Net::HTTP.start(url.host, url.port) { |http|
http.post(path, attributes_for_multipart_post(attributes),
http_headers_for_multipart)
}
4. def self.attributes_for_multipart_post(params)
fp = []
params.each {|k,v|
if v.respond_to?(:read)
fp.push(FileParam.new(k, File.basename(v.path), v.read))
else
fp.push(Param.new(k,v))
end
}
query = fp.collect {|p| "--" + BOUNDARY +
"\r\n" + p.to_multipart }.join("") +
"--" + BOUNDARY + "--"
return query
end
5. query = fp.collect {|p| "--" + BOUNDARY
+ "\r\n" + p.to_multipart }.join("")
+ "--" + BOUNDARY + "--"
Last point - is line reported to cause segfault
After this line in apache log there is following line
[ pid=1345 file=ext/apache2/Hooks.cpp:546 time=2009-04-23 15:29:43.986
]:
Backend process 1366 did not return a valid HTTP response.
It returned no data
|