X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=include%2Fyazproxy%2Fproxy.h;h=7482f52d71e95c2871c6224f285cb3902afc6909;hb=66663d272496cedff1da574891413f90ce716b85;hp=f15171ea7db20388ef8795c5a1537f4fabc5bf23;hpb=6699ea1b1b538de074500e2c740152135dfa75c5;p=yazproxy-moved-to-github.git diff --git a/include/yazproxy/proxy.h b/include/yazproxy/proxy.h index f15171e..7482f52 100644 --- a/include/yazproxy/proxy.h +++ b/include/yazproxy/proxy.h @@ -1,4 +1,4 @@ -/* $Id: proxy.h,v 1.15 2005-05-04 08:31:44 adam Exp $ +/* $Id: proxy.h,v 1.17 2005-05-30 20:09:20 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -22,6 +22,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef YAZ_PROXY_H_INCLUDED #define YAZ_PROXY_H_INCLUDED +#include #include #include #include @@ -48,8 +49,11 @@ enum YAZ_Proxy_MARCXML_mode { marcxml, }; +class Msg_Thread; + /// Information Retrieval Proxy Server. class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { + friend class Proxy_Msg; private: char *get_cookie(Z_OtherInformation **otherInfo); char *get_proxy(Z_OtherInformation **otherInfo); @@ -63,6 +67,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { void releaseClient(); Yaz_ProxyClient *m_client; IYaz_PDU_Observable *m_PDU_Observable; + IYazSocketObservable *m_socket_observable; Yaz_ProxyClient *m_clientPool; Yaz_Proxy *m_parent; int m_seqno; @@ -92,14 +97,13 @@ 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); Z_APDU *handle_query_validation(Z_APDU *apdu); Z_APDU *handle_query_transformation(Z_APDU *apdu); - Z_APDU *handle_query_charset_conversion(Z_APDU *apdu); + Z_APDU *handle_target_charset_conversion(Z_APDU *apdu); Z_APDU *handle_syntax_validation(Z_APDU *apdu); @@ -121,6 +125,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int m_frontend_type; void convert_to_frontend_type(Z_NamePlusRecordList *p); void convert_to_marcxml(Z_NamePlusRecordList *p, const char *charset); + void convert_records_charset(Z_NamePlusRecordList *p, const char *charset); int convert_xsl(Z_NamePlusRecordList *p, Z_APDU *apdu); void convert_xsl_delay(); Z_APDU *m_initRequest_apdu; @@ -164,6 +169,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema); Z_ReferenceId *m_referenceId; NMEM m_referenceId_mem; + #define NO_SPARE_SOLARIS_FD 10 int m_lo_fd[NO_SPARE_SOLARIS_FD]; void low_socket_open(); @@ -174,12 +180,17 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { Yaz_CharsetConverter *m_charset_converter; public: Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable, + IYazSocketObservable *the_socket_observable, Yaz_Proxy *parent = 0); ~Yaz_Proxy(); + int handle_authentication(Z_APDU *apdu); + void result_authentication(Z_APDU *apdu, int ret); + void handle_init(Z_APDU *apdu); void inc_request_no(); void recv_GDU(Z_GDU *apdu, int len); void handle_incoming_HTTP(Z_HTTP_Request *req); void handle_incoming_Z_PDU(Z_APDU *apdu); + void handle_incoming_Z_PDU_2(Z_APDU *apdu); IYaz_PDU_Observer* sessionNotify (IYaz_PDU_Observable *the_PDU_Observable, int fd); void failNotify(); @@ -189,7 +200,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_negotiation (const char *charset, const char *lang); - void set_query_charset(const char *charset); + void set_target_charset(const char *charset); 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; }; @@ -204,6 +215,7 @@ class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc { int get_log_mask() { return m_log_mask; }; int handle_init_response_for_invalid_session(Z_APDU *apdu); void set_debug_mode(int mode); + Msg_Thread *m_my_thread; }; #endif