From 90dcde08cb73241173e22e84362c6acf9ee92276 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 14 Apr 2008 14:49:08 +0200 Subject: [PATCH] Removed the GAGA code sections. 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 | 7 ------- src/http.c | 57 ------------------------------------------------------- src/logic.c | 9 --------- src/relevance.c | 28 --------------------------- src/settings.c | 16 ---------------- 5 files changed, 117 deletions(-) diff --git a/src/config.c b/src/config.c index 2b44547..f02d169 100644 --- a/src/config.c +++ b/src/config.c @@ -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); diff --git a/src/http.c b/src/http.c index c2bf0a4..cdf2c26 100644 --- a/src/http.c +++ b/src/http.c @@ -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); diff --git a/src/logic.c b/src/logic.c index d7fb5c0..350d880 100644 --- a/src/logic.c +++ b/src/logic.c @@ -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 } diff --git a/src/relevance.c b/src/relevance.c index 1a9f4d7..a30892f 100644 --- a/src/relevance.c +++ b/src/relevance.c @@ -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); } diff --git a/src/settings.c b/src/settings.c index a41f23c..5cb08c1 100644 --- a/src/settings.c +++ b/src/settings.c @@ -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 -- 1.7.10.4