From: miker Date: Fri, 6 Jul 2007 16:20:53 +0000 (+0000) Subject: providing for "just flesh as deep as you can" functionallity with flesh == -1; in... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5f699c1daf996aa603e918a688569c4a7c1fdc2c;p=Evergreen.git providing for "just flesh as deep as you can" functionallity with flesh == -1; in-code max of 1000, default configured max of 100 git-svn-id: svn://svn.open-ils.org/ILS/trunk@7530 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/examples/opensrf.xml.example b/Open-ILS/examples/opensrf.xml.example index f1c65c2f6f..367dd411c1 100644 --- a/Open-ILS/examples/opensrf.xml.example +++ b/Open-ILS/examples/opensrf.xml.example @@ -519,7 +519,7 @@ Example opensrf config file for OpenILS 5 - /openils/conf/fm_IDL.xml + 100 pgsql master @@ -605,18 +605,17 @@ Example opensrf config file for OpenILS 5 - /openils/conf/fm_IDL.xml - pgsql - - master - 2 - postgres - localhost - 5432 - postgres - evergreen - UTF-8 - + pgsql + + master + 2 + postgres + localhost + 5432 + postgres + evergreen + UTF-8 + diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index c87d3559eb..51d06afe08 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -67,6 +67,7 @@ dbi_conn writehandle; /* our MASTER db connection */ dbi_conn dbhandle; /* our CURRENT db connection */ osrfHash readHandles; jsonObject* jsonNULL = NULL; // +static int max_flesh_depth = 100; /* called when this process is about to exit */ void osrfAppChildExit() { @@ -224,6 +225,7 @@ int osrfAppChildInit() { char* port = osrf_settings_host_value("/apps/%s/app_settings/database/port", MODULENAME); char* db = osrf_settings_host_value("/apps/%s/app_settings/database/db", MODULENAME); char* pw = osrf_settings_host_value("/apps/%s/app_settings/database/pw", MODULENAME); + char* md = osrf_settings_host_value("/apps/%s/app_settings/max_query_recursion", MODULENAME); osrfLogDebug(OSRF_LOG_MARK, "Attempting to load the database driver [%s]...", driver); writehandle = dbi_conn_new(driver); @@ -243,6 +245,10 @@ int osrfAppChildInit() { if(pw) dbi_conn_set_option(writehandle, "password", pw ); if(db) dbi_conn_set_option(writehandle, "dbname", db ); + if(md) max_flesh_depth = atoi(md); + if(max_flesh_depth < 0) max_flesh_depth = 1; + if(max_flesh_depth > 1000) max_flesh_depth = 1000; + free(user); free(host); free(port); @@ -2335,6 +2341,7 @@ jsonObject* doFieldmapperSearch ( osrfMethodContext* ctx, osrfHash* meta, jsonOb _tmp = jsonObjectGetKey( order_hash, "flesh" ); if (_tmp) { int x = (int)jsonObjectGetNumber(_tmp); + if (x == -1 || x > max_flesh_depth) x = max_flesh_depth; jsonObject* flesh_blob = NULL; if ((flesh_blob = jsonObjectGetKey( order_hash, "flesh_fields" )) && x > 0) {