X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=include%2Fyazproxy%2Fproxy.h;h=120a9c4f60631ad6c2104b3757184494c11c6f36;hb=d6baec0e7369dd5d01a2998efb3667e3deff6db2;hp=c9c64ee3c3cc6997379006dac148ec5bc3beb196;hpb=676640cef321916c94661bd53749130d86555bb9;p=yazproxy-moved-to-github.git diff --git a/include/yazproxy/proxy.h b/include/yazproxy/proxy.h index c9c64ee..120a9c4 100644 --- a/include/yazproxy/proxy.h +++ b/include/yazproxy/proxy.h @@ -1,4 +1,4 @@ -/* $Id: proxy.h,v 1.8 2004-10-23 23:12:24 adam Exp $ +/* $Id: proxy.h,v 1.11 2005-02-10 08:09:42 oleg Exp $ Copyright (c) 1998-2004, Index Data. This file is part of the yaz-proxy. @@ -19,6 +19,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef YAZ_PROXY_H_INCLUDED +#define YAZ_PROXY_H_INCLUDED + #include #include #include @@ -37,6 +40,7 @@ class Yaz_Proxy; struct Yaz_RecordCache_Entry; class Yaz_ProxyConfigP; +class Yaz_usemarcon; class YAZ_EXPORT Yaz_ProxyConfig { public: @@ -57,7 +61,9 @@ public: int *keepalive_limit_pdu, int *pre_init, const char **cql2rpn, - const char **authentication); + const char **authentication, + const char **negotiation_charset, + const char **negotiation_lang); void get_generic_info(int *log_mask, int *max_clients); @@ -68,13 +74,18 @@ public: int *keepalive_limit_bw, int *keepalive_limit_pdu, int *pre_init, const char **cql2rpn, - const char **authentication); + const char **authentication, + const char **negotiation_charset, + const char **negotiation_lang); + const char *check_mime_type(const char *path); 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 **backend_type, char **backend_charset); + char **backend_type, char **backend_charset, + char **usemarcon_ini_stage1, char **usemarcon_ini_stage2 + ); 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); @@ -159,6 +170,8 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { private: char *get_cookie(Z_OtherInformation **otherInfo); char *get_proxy(Z_OtherInformation **otherInfo); + void get_charset_and_lang_negotiation(Z_OtherInformation **otherInfo, + char **charstes, char **langs, int *selected); 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); @@ -179,6 +192,8 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { char *m_proxyTarget; char *m_default_target; char *m_proxy_authentication; + char *m_proxy_negotiation_charset; + char *m_proxy_negotiation_lang; long m_seed; char *m_optimize; int m_session_no; // sequence for each client session @@ -202,6 +217,9 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Z_APDU *handle_query_transformation(Z_APDU *apdu); Z_APDU *handle_syntax_validation(Z_APDU *apdu); + + void handle_charset_lang_negotiation(Z_APDU *apdu); + const char *load_balance(const char **url); int m_reconfig_flag; Yaz_ProxyConfig *check_reconfigure(); @@ -225,6 +243,11 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int m_initRequest_maximumRecordSize; Z_Options *m_initRequest_options; Z_ProtocolVersion *m_initRequest_version; + char **m_initRequest_oi_negotiation_charsets; + int m_initRequest_oi_negotiation_num_charsets; + char **m_initRequest_oi_negotiation_langs; + int m_initRequest_oi_negotiation_num_langs; + int m_initRequest_oi_negotiation_selected; NMEM m_initRequest_mem; Z_APDU *m_apdu_invalid_session; NMEM m_mem_invalid_session; @@ -239,6 +262,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Z_APDU *m_s2z_present_apdu; char *m_s2z_stylesheet; char *m_soap_ns; + int file_access(Z_HTTP_Request *hreq); int send_to_srw_client_error(int error, const char *add); int send_to_srw_client_ok(int hits, Z_Records *records, int start); int send_http_response(int code); @@ -259,6 +283,9 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int m_lo_fd[NO_SPARE_SOLARIS_FD]; void low_socket_open(); void low_socket_close(); + char *m_usemarcon_ini_stage1; + char *m_usemarcon_ini_stage2; + Yaz_usemarcon *m_usemarcon; public: Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, Yaz_Proxy *parent = 0); @@ -276,6 +303,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { const char *option(const char *name, const char *value); void set_default_target(const char *target); void set_proxy_authentication (const char *auth); + void set_proxy_negotiation (const char *charset, const char *lang); char *get_proxy_target() { return m_proxyTarget; }; char *get_session_str() { return m_session_str; }; void set_max_clients(int m) { m_max_clients = m; }; @@ -291,3 +319,4 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int handle_init_response_for_invalid_session(Z_APDU *apdu); }; +#endif