From 43a69e7127c65f2651a61300d3e32bf6f89a2595 Mon Sep 17 00:00:00 2001 From: canyonknight Date: Sun, 21 Oct 2012 15:53:16 -0400 Subject: aurjson.class.php: Limit number of RPC results With no limit to the number of results, memory_limit set to 32M can easily be exceeded for searches that have a large number of results. This results in an HTTP error 500 for those queries. Limit results to an amount set within config.inc.php to avoid exceeding memory_limit. Introduce new JSON error code for when the result limit is hit. Fixes FS#31849 Signed-off-by: canyonknight Signed-off-by: Lukas Fleischer --- web/lib/config.inc.php.proto | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/lib/config.inc.php.proto') diff --git a/web/lib/config.inc.php.proto b/web/lib/config.inc.php.proto index f1324458..1fe7dbc4 100644 --- a/web/lib/config.inc.php.proto +++ b/web/lib/config.inc.php.proto @@ -55,3 +55,7 @@ $AUR_LOCATION = "http://localhost"; # Use virtual URLs -- to enable this feature, you also need to tell your web # server to redirect all requests to "/index.php/$uri". $USE_VIRTUAL_URLS = true; + +# Maximum number of package results to return through an RPC connection. +# Avoid setting this too high and having a PHP too much memory error. +$MAX_RPC_RESULTS = 5000; -- cgit v1.2.3-24-g4f1b