X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=include%2Fyazproxy%2Fproxy.h;h=542ec8a16763d3c14bb783c1d8b1dc269172b125;hp=a26a6d00dfde3d66930ed6bd04a1f9fb06150206;hb=91f84eaf3ca73d717e7c462359127fd44e795bd9;hpb=645fcfb030d718ce708a396309fb8d69bd8d7afb diff --git a/include/yazproxy/proxy.h b/include/yazproxy/proxy.h index a26a6d0..542ec8a 100644 --- a/include/yazproxy/proxy.h +++ b/include/yazproxy/proxy.h @@ -1,14 +1,14 @@ -/* $Id: proxy.h,v 1.3 2004-04-11 12:25:01 adam Exp $ +/* $Id: proxy.h,v 1.7 2004-10-18 22:10:57 adam Exp $ Copyright (c) 1998-2004, Index Data. This file is part of the yaz-proxy. -Zebra is free software; you can redistribute it and/or modify it under +YAZ proxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. -Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,21 +19,12 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if HAVE_GETTIMEOFDAY -#include -#endif #include #include #include #include #include #include -#if HAVE_XSLT -#include -#include -#include -#include -#endif class Yaz_Proxy; @@ -45,6 +36,7 @@ class Yaz_Proxy; #define PROXY_LOG_REQ_SERVER 8 struct Yaz_RecordCache_Entry; +class Yaz_ProxyConfigP; class YAZ_EXPORT Yaz_ProxyConfig { public: @@ -79,38 +71,14 @@ public: int check_query(ODR odr, const char *name, Z_Query *query, char **addinfo); int check_syntax(ODR odr, const char *name, Odr_oid *syntax, Z_RecordComposition *comp, - char **addinfo, char **stylesheet, char **schema); - char *get_explain(ODR odr, const char *name, const char *db, - int *len); -private: + char **addinfo, char **stylesheet, char **schema, + char **backend_type, char **backend_charset); + char *get_explain_doc(ODR odr, const char *name, const char *db, + int *len); + const char *get_explain_name(const char *db, const char **backend_db); + private: void operator=(const Yaz_ProxyConfig &conf); - int mycmp(const char *hay, const char *item, size_t len); -#if HAVE_XSLT - int check_schema(xmlNodePtr ptr, Z_RecordComposition *comp, - const char *schema_identifier); - xmlDocPtr m_docPtr; - xmlNodePtr m_proxyPtr; - void return_target_info(xmlNodePtr ptr, const char **url, - int *limit_bw, int *limit_pdu, int *limit_req, - int *target_idletime, int *client_idletime, - int *keepalive_limit_bw, int *keepalive_limit_pdu, - int *pre_init, const char **cql2rpn); - void return_limit(xmlNodePtr ptr, - int *limit_bw, int *limit_pdu, int *limit_req); - int check_type_1(ODR odr, xmlNodePtr ptr, Z_RPNQuery *query, - char **addinfo); - xmlNodePtr find_target_node(const char *name, const char *db); - xmlNodePtr find_target_db(xmlNodePtr ptr, const char *db); - const char *get_text(xmlNodePtr ptr); - int check_type_1_attributes(ODR odr, xmlNodePtr ptr, - Z_AttributeList *attrs, - char **addinfo); - int check_type_1_structure(ODR odr, xmlNodePtr ptr, Z_RPNStructure *q, - char **addinfo); -#endif - int m_copy; - int match_list(int v, const char *m); - int atoi_l(const char **cp); + class Yaz_ProxyConfigP *m_cp; }; class YAZ_EXPORT Yaz_RecordCache { @@ -191,9 +159,10 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { char *get_proxy(Z_OtherInformation **otherInfo); Yaz_ProxyClient *get_client(Z_APDU *apdu, const char *cookie, const char *proxy_host); + void srw_get_client(const char *db, const char **backend_db); Z_APDU *result_set_optimize(Z_APDU *apdu); void shutdown(); - + void releaseClient(); Yaz_ProxyClient *m_client; IYaz_PDU_Observable *m_PDU_Observable; Yaz_ProxyClient *m_clientPool; @@ -237,16 +206,16 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int m_request_no; int m_invalid_session; int m_marcxml_flag; -#if HAVE_XSLT - xsltStylesheetPtr m_stylesheet_xsp; -#else - void *m_stylesheet_xsp; -#endif + void *m_stylesheet_xsp; // Really libxslt's xsltStylesheetPtr int m_stylesheet_offset; Z_APDU *m_stylesheet_apdu; Z_NamePlusRecordList *m_stylesheet_nprl; char *m_schema; - void convert_to_marcxml(Z_NamePlusRecordList *p); + char *m_backend_type; + char *m_backend_charset; + int m_frontend_type; + void convert_to_frontend_type(Z_NamePlusRecordList *p); + void convert_to_marcxml(Z_NamePlusRecordList *p, const char *charset); int convert_xsl(Z_NamePlusRecordList *p, Z_APDU *apdu); void convert_xsl_delay(); Z_APDU *m_initRequest_apdu; @@ -279,9 +248,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int m_http_keepalive; const char *m_http_version; Yaz_cql2rpn m_cql2rpn; -#if HAVE_GETTIMEOFDAY - struct timeval m_time_tv; -#endif + void *m_time_tv; void logtime(); Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema); Z_ReferenceId *m_referenceId;