providing for "just flesh as deep as you can" functionallity with flesh == -1; in...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 6 Jul 2007 16:20:53 +0000 (16:20 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 6 Jul 2007 16:20:53 +0000 (16:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@7530 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/opensrf.xml.example
Open-ILS/src/c-apps/oils_cstore.c

index f1c65c2..367dd41 100644 (file)
@@ -519,7 +519,7 @@ Example opensrf config file for OpenILS
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
                 <app_settings>
-                    <IDL>/openils/conf/fm_IDL.xml</IDL> <!-- deprecated with 1.1.0-->
+                    <max_query_recursion>100</max_query_recursion>
                     <driver>pgsql</driver>
                     <database>
                         <type>master</type>
@@ -605,18 +605,17 @@ Example opensrf config file for OpenILS
                     <max_spare_children>5</max_spare_children>
                 </unix_config>
                 <app_settings>
-                <IDL>/openils/conf/fm_IDL.xml</IDL> <!-- deprecated with 1.1.0 -->
-                <driver>pgsql</driver>
-                <database>
-                    <type>master</type>
-                    <weight>2</weight>
-                    <user>postgres</user>
-                    <host>localhost</host>
-                    <port>5432</port>
-                    <pw>postgres</pw>
-                    <db>evergreen</db>
-                    <client_encoding>UTF-8</client_encoding>
-                </database>
+                    <driver>pgsql</driver>
+                    <database>
+                        <type>master</type>
+                        <weight>2</weight>
+                        <user>postgres</user>
+                        <host>localhost</host>
+                        <port>5432</port>
+                        <pw>postgres</pw>
+                        <db>evergreen</db>
+                        <client_encoding>UTF-8</client_encoding>
+                    </database>
                 </app_settings>
             </open-ils.reporter-store>
 
index c87d355..51d06af 100644 (file)
@@ -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) {