X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=src%2Fyaz-proxy.cpp;h=930f7c221d1f0b7777ea48f438cfac7b1a80b420;hp=35c5ba22ab2360dc95431f14107501e8049ec529;hb=7fa984c171c65d05d34775c4533808793b2109cb;hpb=7b429cd9f6320f71b949f7e90270266b2f617c07 diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 35c5ba2..930f7c2 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -864,13 +864,13 @@ void Yaz_Proxy::display_diagrecs(Z_DiagRec **pp, int num) switch (r->which) { case Z_DefaultDiagFormat_v2Addinfo: - yaz_log(YLOG_LOG, "%sError %d %s:%s", + yaz_log(YLOG_LOG, "%sError " ODR_INT_PRINTF " %s:%s", m_session_str, *r->condition, diagbib1_str(*r->condition), r->u.v2Addinfo); break; case Z_DefaultDiagFormat_v3Addinfo: - yaz_log(YLOG_LOG, "%sError %d %s:%s", + yaz_log(YLOG_LOG, "%sError " ODR_INT_PRINTF " %s:%s", m_session_str, *r->condition, diagbib1_str(*r->condition), r->u.v3Addinfo); @@ -1494,7 +1494,7 @@ int Yaz_Proxy::send_to_client(Z_APDU *apdu) } if (sr->resultCount) { - yaz_log(YLOG_LOG, "%s%d hits", m_session_str, + yaz_log(YLOG_LOG, "%s" ODR_INT_PRINTF " hits", m_session_str, *sr->resultCount); if (*sr->resultCount < 0) { @@ -2310,7 +2310,7 @@ Z_Records *Yaz_Proxy::create_nonSurrogateDiagnostics(ODR odr, { Z_Records *rec = (Z_Records *) odr_malloc (odr, sizeof(*rec)); - int *err = (int *) + Odr_int *err = (Odr_int *) odr_malloc (odr, sizeof(*err)); Z_DiagRec *drec = (Z_DiagRec *) odr_malloc (odr, sizeof(*drec)); @@ -2819,7 +2819,14 @@ void Yaz_Proxy::handle_incoming_HTTP(Z_HTTP_Request *hreq) m_s2z_stylesheet = 0; Z_IdAuthentication *auth = NULL; - if (srw_pdu->username && srw_pdu->password) + if (srw_pdu->username && !srw_pdu->password) + { + yaz_log(YLOG_LOG, "username: %s\n", srw_pdu->username); + auth = (Z_IdAuthentication *) odr_malloc(m_s2z_odr_init, sizeof(Z_IdAuthentication)); + auth->which = Z_IdAuthentication_open; + auth->u.open = odr_strdup(m_s2z_odr_init, srw_pdu->username); + } + else if (srw_pdu->username && srw_pdu->password) { yaz_log(YLOG_LOG, "username/password: %s/%s\n", srw_pdu->username, srw_pdu->password); @@ -3967,6 +3974,7 @@ void Yaz_Proxy::base64_decode(const char *base64, char *buf, int buf_len) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab