Removed the GAGA code sections.
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 14 Apr 2008 12:49:08 +0000 (14:49 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 14 Apr 2008 12:49:08 +0000 (14:49 +0200)
The GAGA code sections are old experimental code which was added
Nov 24 20:29:07 2006. This code has not been enabled for a long
time and no longer compiles anyway.

src/config.c
src/http.c
src/logic.c
src/relevance.c
src/settings.c

index 2b44547..f02d169 100644 (file)
@@ -456,13 +456,6 @@ static struct conf_server *parse_server(xmlNode *node)
                 server->proxy_host = nmem_strdup(nmem, (const char *) host);
             if (myurl)
                 server->myurl = nmem_strdup(nmem, (const char *) myurl);
-#ifdef GAGA
-            else
-            {
-                yaz_log(YLOG_FATAL, "Must specify @myurl for proxy");
-                return 0;
-            }
-#endif
             xmlFree(port);
             xmlFree(host);
             xmlFree(myurl);
index c2bf0a4..cdf2c26 100644 (file)
@@ -116,17 +116,6 @@ static void http_buf_destroy_queue(struct http_buf *b)
     }
 }
 
-#ifdef GAGA
-// Calculate length of chain
-static int http_buf_len(struct http_buf *b)
-{
-    int sum = 0;
-    for (; b; b = b->next)
-        sum += b->len;
-    return sum;
-}
-#endif
-
 static struct http_buf *http_buf_bybuf(char *b, int len)
 {
     struct http_buf *res = 0;
@@ -913,25 +902,6 @@ static void http_io(IOCHAN i, int event)
     }
 }
 
-#ifdef GAGA
-// If this hostname contains our proxy host as a prefix, replace with myurl
-static char *sub_hostname(struct http_channel *c, char *buf)
-{
-    char tmp[1024];
-    if (strlen(buf) > 1023)
-        return buf;
-    if (strncmp(buf, "http://", 7))
-        return buf;
-    if (!strncmp(buf + 7, proxy_url, strlen(proxy_url)))
-    {
-        strcpy(tmp, myurl);
-        strcat(tmp, buf + strlen(proxy_url) + 7);
-        return nmem_strdup(c->nmem, tmp);
-    }
-    return buf;
-}
-#endif
-
 // Handles I/O on a client connection to a backend web server (proxy mode)
 static void proxy_io(IOCHAN pi, int event)
 {
@@ -968,33 +938,6 @@ static void proxy_io(IOCHAN pi, int event)
                 htbuf->buf[res] = '\0';
                 htbuf->offset = 0;
                 htbuf->len = res;
-#ifdef GAGA
-                if (pc->first_response) // Check if this is a redirect
-                {
-                    int len;
-                    if ((len = package_check(htbuf->buf)))
-                    {
-                        struct http_response *res = http_parse_response_buf(hc, htbuf->buf, len);
-                        if (res)
-                        {
-                            const char *location = http_lookup_header(
-                                res->header, "Location");
-                            if (location)
-                            {
-                                // We found a location header. Rewrite it.
-                                struct http_buf *buf;
-                                h->value = sub_hostname(hc, location);
-                                buf = http_serialize_response(hc, res);
-                                yaz_log(YLOG_LOG, "Proxy rewrite");
-                                http_buf_enqueue(&hc->oqueue, buf);
-                                htbuf->offset = len;
-                                break;
-                            }
-                        }
-                    }
-                    pc->first_response = 0;
-                }
-#endif
                 // Write any remaining payload
                 if (htbuf->len - htbuf->offset > 0)
                     http_buf_enqueue(&hc->oqueue, htbuf);
index d7fb5c0..350d880 100644 (file)
@@ -1308,15 +1308,6 @@ struct record *ingest_record(struct client *cl, Z_External *rec,
                     if (this_max > (*wheretoput)->data.number.max)
                         (*wheretoput)->data.number.max = this_max;
                 }
-#ifdef GAGA
-                if (ser_sk)
-                {
-                    union data_types *sdata 
-                        = cluster->sortkeys[sk_field_id];
-                    yaz_log(YLOG_LOG, "SK range: %d-%d",
-                            sdata->number.min, sdata->number.max);
-                }
-#endif
             }
 
 
index 1a9f4d7..a30892f 100644 (file)
@@ -284,31 +284,6 @@ void relevance_donerecord(struct relevance *r, struct record_cluster *cluster)
     r->doc_frequency_vec[0]++;
 }
 
-#ifdef GAGA
-#ifdef FLOAT_REL
-static int comp(const void *p1, const void *p2)
-{
-    float res;
-    struct record **r1 = (struct record **) p1;
-    struct record **r2 = (struct record **) p2;
-    res = (*r2)->relevance - (*r1)->relevance;
-    if (res > 0)
-        return 1;
-    else if (res < 0)
-        return -1;
-    else
-        return 0;
-}
-#else
-static int comp(const void *p1, const void *p2)
-{
-    struct record_cluster **r1 = (struct record_cluster **) p1;
-    struct record_cluster **r2 = (struct record_cluster **) p2;
-    return (*r2)->relevance - (*r1)->relevance;
-}
-#endif
-#endif
-
 // Prepare for a relevance-sorted read
 void relevance_prepare_read(struct relevance *rel, struct reclist *reclist)
 {
@@ -350,9 +325,6 @@ void relevance_prepare_read(struct relevance *rel, struct reclist *reclist)
         }
         rec->relevance = (int) (relevance * 100000);
     }
-#ifdef GAGA
-    qsort(reclist->flatlist, reclist->num_records, sizeof(struct record*), comp);
-#endif
     reclist->pointer = 0;
     xfree(idfvec);
 }
index a41f23c..5cb08c1 100644 (file)
@@ -313,22 +313,6 @@ static void update_database(void *context, struct database *db)
     if (!match_zurl(db->url, set->target))
         return;
 
-#ifdef GAGA
-    // Initialize settings array if it doesn't exist.
-    // If so, also set the 'id' automatic setting
-    if (!db->settings)
-    {
-        struct setting *id = nmem_malloc(nmem, sizeof(struct setting));
-
-        db->settings = nmem_malloc(nmem, sizeof(struct settings*) * dictionary->num);
-        memset(db->settings, 0, sizeof(struct settings*) * dictionary->num);
-        id->precedence = 0;
-        id->name = "pz:id";
-        id->target = id->value = db->url;
-        id->next = 0;
-        db->settings[PZ_ID] = id;
-    }
-#endif
     if ((offset = settings_offset_cprefix(set->name)) < 0)
         abort(); // Should never get here