X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-ir-assoc.cpp;h=a6eac26505ef38c8eef1f1a727cf3141def1d7d7;hb=66767801433aba6cd2ac9fc744a1057867df7fa9;hp=ef084a1ed5341236ed73ba6f41529391c1760a79;hpb=e08f9ff89133cbc295dda92b9c863ddd288569d1;p=yazpp-moved-to-github.git diff --git a/src/yaz-ir-assoc.cpp b/src/yaz-ir-assoc.cpp index ef084a1..a6eac26 100644 --- a/src/yaz-ir-assoc.cpp +++ b/src/yaz-ir-assoc.cpp @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: yaz-ir-assoc.cpp,v $ - * Revision 1.8 1999-04-28 13:04:03 adam + * Revision 1.10 1999-04-29 07:33:28 adam + * Changed setting of host in connect/proxy setting. YAZ' strtoaddr now + * ignores database part of host. + * + * Revision 1.9 1999/04/28 13:29:14 adam + * Yet another fix regarding database settings. + * + * Revision 1.8 1999/04/28 13:04:03 adam * Fixed setting of proxy otherInfo so that database(s) are removed. * * Revision 1.7 1999/04/21 12:09:01 adam @@ -290,17 +297,10 @@ void Yaz_IR_Assoc::client(const char *addr) delete [] m_host; m_host = new char[strlen(addr)+1]; strcpy(m_host, addr); - const char *zurl_p = (m_proxy ? m_proxy : m_host); - char *zurl = new char[strlen(zurl_p)+1]; - strcpy(zurl, zurl_p); - char *dbpart = strchr(zurl, '/'); + const char *dbpart = strchr(m_host, '/'); if (dbpart) - { set_databaseNames (dbpart+1, "+ "); - *dbpart = '\0'; - } - Yaz_Z_Assoc::client(zurl); - delete [] zurl; + Yaz_Z_Assoc::client(m_proxy ? m_proxy : m_host); } const char *Yaz_IR_Assoc::get_proxy() @@ -372,15 +372,7 @@ int Yaz_IR_Assoc::send_initRequest() ODR_MASK_SET(req->protocolVersion, Z_ProtocolVersion_3); if (m_proxy && m_host) - { - char *rawhost = new char[strlen(m_host)+1]; - strcpy(rawhost, m_host); - char *dbpart = strchr(rawhost, '/'); - if (dbpart) - *dbpart = '\0'; - set_otherInformationString(&req->otherInfo, VAL_PROXY, 1, rawhost); - delete [] rawhost; - } + set_otherInformationString(&req->otherInfo, VAL_PROXY, 1, m_host); if (m_cookie) set_otherInformationString(&req->otherInfo, VAL_COOKIE, 1, m_cookie); return send_Z_PDU(apdu);