\brief high-level logic; mostly user sessions and settings
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#if HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif
+#if HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#if HAVE_NETDB_H
#include <netdb.h>
+#endif
#include <signal.h>
#include <ctype.h>
#include <assert.h>
#include <yaz/oid_db.h>
#include <yaz/snprintf.h>
-#if HAVE_CONFIG_H
-#include "cconfig.h"
-#endif
-
#define USE_TIMING 0
#if USE_TIMING
#include <yaz/timing.h>
#endif
+#if HAVE_NETINET_IN_H
#include <netinet/in.h>
+#endif
#include "pazpar2.h"
#include "eventl.h"
#include "termlists.h"
#include "reclists.h"
#include "relevance.h"
-#include "config.h"
#include "database.h"
#include "client.h"
#include "settings.h"
session->relevance = 0;
session->total_hits = 0;
session->total_records = 0;
+ session->number_of_warnings_unknown_elements = 0;
session->num_termlists = 0;
session->reclist = 0;
session->requestid = -1;
stat->num_clients = count;
}
-void start_http_listener(void)
+int start_http_listener(void)
{
char hp[128] = "";
struct conf_server *ser = global_parameters.server;
sprintf(hp + strlen(hp), "%d", ser->port);
}
}
- http_init(hp);
+ return http_init(hp);
}
void start_proxy(void)
value, type);
continue;
}
- rec_md->next = record->metadata[md_field_id];
- record->metadata[md_field_id] = rec_md;
+ wheretoput = &record->metadata[md_field_id];
+ while (*wheretoput)
+ wheretoput = &(*wheretoput)->next;
+ *wheretoput = rec_md;
// merged metadata
rec_md = record_metadata_init(se->nmem, (char *) value,
xmlFree(value);
type = value = 0;
}
- else
- yaz_log(YLOG_WARN,
- "Unexpected element %s in internal record", n->name);
+ else
+ {
+ if (se->number_of_warnings_unknown_elements == 0)
+ yaz_log(YLOG_WARN,
+ "Unexpected element in internal record: %s", n->name);
+ se->number_of_warnings_unknown_elements++;
+ }
}
if (type)
xmlFree(type);