aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIan Chard <ian@mysociety.org>2013-05-15 09:33:30 +0100
committerIan Chard <ian@mysociety.org>2013-05-15 09:33:30 +0100
commit66787c68b96e9e31e9081c25f793e69d9ae789fe (patch)
treef9462ce0bf1600dc1fc81022003a16d7d8401e9b /lib
parent1071cade0f4bc928ec70e99ffe8624e7f6b52846 (diff)
Limit memory available to wvText, which calls elinks
Diffstat (limited to 'lib')
-rw-r--r--lib/mail_handler/mail_handler.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mail_handler/mail_handler.rb b/lib/mail_handler/mail_handler.rb
index 8b227b9ca..cd5abfab7 100644
--- a/lib/mail_handler/mail_handler.rb
+++ b/lib/mail_handler/mail_handler.rb
@@ -84,7 +84,8 @@ module MailHandler
tempfile.flush
default_params = { :append_to => text, :binary_output => false }
if content_type == 'application/vnd.ms-word'
- AlaveteliExternalCommand.run("wvText", tempfile.path, tempfile.path + ".txt")
+ AlaveteliExternalCommand.run("wvText", tempfile.path, tempfile.path + ".txt",
+ { :memory_limit => 536870912 } )
# Try catdoc if we get into trouble (e.g. for InfoRequestEvent 2701)
if not File.exists?(tempfile.path + ".txt")
AlaveteliExternalCommand.run("catdoc", tempfile.path, default_params)