X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fsession.c;h=61f7e54ebd1c8de77f28c73eb144438b1d6d1fba;hb=e5f5c04e9c9e3c9001e53981fdbad03e1c3842d2;hp=f2acbaaa7ad40218e5cb2b4241498688fb1be3f5;hpb=649a9d45b919c376ddcbb89e0d34c4efeeb29fb9;p=pazpar2-moved-to-github.git diff --git a/src/session.c b/src/session.c index f2acbaa..61f7e54 100644 --- a/src/session.c +++ b/src/session.c @@ -35,6 +35,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #if HAVE_UNISTD_H #include #endif +#ifdef WIN32 +#include +#endif #include #include #include @@ -52,6 +55,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include #define USE_TIMING 0 #if USE_TIMING @@ -537,7 +541,7 @@ enum pazpar2_error_code search(struct session *se, } se->reclist = reclist_create(se->nmem); - gettimeofday(&tval, 0); + yaz_gettimeofday(&tval); tval.tv_sec += 5; @@ -977,7 +981,10 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name, if (!strcmp((const char *) n->name, "metadata")) { xmlChar *type = xmlGetProp(n, (xmlChar *) "type"); - if (!strcmp(name, (const char *) type)) + if (type == NULL) { + yaz_log(YLOG_FATAL, "Missing type attribute on metadata element. Skipping!"); + } + else if (!strcmp(name, (const char *) type)) { xmlChar *value = xmlNodeListGetString(doc, n->children, 1); if (value) @@ -1136,6 +1143,7 @@ static int ingest_to_cluster(struct client *cl, \param cl client holds the result set for record \param rec record buffer (0 terminated) \param record_no record position (1, 2, ..) + \param nmem working NMEM \retval 0 OK \retval -1 failure */