X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyazproxy%2Fproxy.h;h=264aac52b81d0be31c43ad72a0ffa1219a29e7c6;hb=c6ca4f0f79d5ea0ca391d420bcb6dd6b4d7935d2;hp=542ec8a16763d3c14bb783c1d8b1dc269172b125;hpb=91f84eaf3ca73d717e7c462359127fd44e795bd9;p=yazproxy-moved-to-github.git diff --git a/include/yazproxy/proxy.h b/include/yazproxy/proxy.h index 542ec8a..264aac5 100644 --- a/include/yazproxy/proxy.h +++ b/include/yazproxy/proxy.h @@ -1,5 +1,5 @@ -/* $Id: proxy.h,v 1.7 2004-10-18 22:10:57 adam Exp $ - Copyright (c) 1998-2004, Index Data. +/* $Id: proxy.h,v 1.12 2005-02-11 15:19:08 adam Exp $ + Copyright (c) 1998-2005, 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: @@ -56,7 +60,10 @@ public: int *keepalive_limit_bw, int *keepalive_limit_pdu, int *pre_init, - const char **cql2rpn); + const char **cql2rpn, + const char **authentication, + const char **negotiation_charset, + const char **negotiation_lang); void get_generic_info(int *log_mask, int *max_clients); @@ -66,13 +73,21 @@ public: int *max_clients, int *keepalive_limit_bw, int *keepalive_limit_pdu, int *pre_init, - const char **cql2rpn); + const char **cql2rpn, + 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); + + int check_authentication(const char *user, const char *group, + const char *password); 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); @@ -157,6 +172,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); @@ -177,6 +194,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 @@ -192,6 +211,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Z_GDU *m_bw_hold_PDU; int m_max_record_retrieve; void handle_max_record_retrieve(Z_APDU *apdu); + int handle_authentication(Z_APDU *apdu); void display_diagrecs(Z_DiagRec **pp, int num); Z_Records *create_nonSurrogateDiagnostics(ODR o, int error, const char *addinfo); @@ -200,6 +220,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(); @@ -223,6 +246,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; @@ -237,6 +265,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); @@ -257,6 +286,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); @@ -274,6 +306,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; }; @@ -289,3 +322,4 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int handle_init_response_for_invalid_session(Z_APDU *apdu); }; +#endif