-/* $Id: client.c,v 1.2 2007-04-24 07:04:36 adam Exp $
+/* $Id: client.c,v 1.6 2007-06-02 04:32:28 quinn Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
Z_Records *recs = r->records;
if (recs->which == Z_Records_NSD)
{
- yaz_log(YLOG_WARN,
- "Search response: Non-surrogate diagnostic %s",
- cl->database->database->url);
+ yaz_log(YLOG_WARN,
+ "Search response: Non-surrogate diagnostic %s (%d)",
+ cl->database->database->url,
+ *recs->u.nonSurrogateDiagnostic->condition);
cl->diagnostic = *recs->u.nonSurrogateDiagnostic->condition;
cl->state = Client_Error;
}
struct session_database *sdb = client_get_database(cl);
char *auth = session_setting_oneval(sdb, PZ_AUTHENTICATION);
- if (auth)
+ if (*auth)
{
+ struct connection *co = client_get_connection(cl);
+ struct session *se = client_get_session(cl);
Z_IdAuthentication *idAuth = odr_malloc(global_parameters.odr_out,
sizeof(*idAuth));
idAuth->which = Z_IdAuthentication_open;
idAuth->u.open = auth;
req->idAuthentication = idAuth;
+ connection_set_authentication(co, nmem_strdup(se->session_nmem, auth));
}
}
}
wrbuf_rewind(se->wrbuf);
ccl_pquery(se->wrbuf, cn);
- wrbuf_putc(se->wrbuf, '\0');
- if (cl->pquery)
- xfree(cl->pquery);
- cl->pquery = xstrdup(wrbuf_buf(se->wrbuf));
+ xfree(cl->pquery);
+ cl->pquery = xstrdup(wrbuf_cstr(se->wrbuf));
if (!se->relevance)
{
// Initialize relevance structure with query terms
char *p[512];
extract_terms(se->nmem, cn, p);
- se->relevance = relevance_create(se->nmem, (const char **) p,
- se->expected_maxrecs);
+ se->relevance = relevance_create(client_get_database(cl)->pct,
+ se->nmem, (const char **) p,
+ se->expected_maxrecs);
}
ccl_rpn_delete(cn);