-/* $Id: proxy.h,v 1.18 2005-06-02 06:40:46 adam Exp $
+/* $Id: proxy.h,v 1.21 2005-06-21 18:46:04 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
#include <yaz++/z-databases.h>
#include <yaz++/cql2rpn.h>
#include <yaz/cql.h>
+#include <yaz++/gdu.h>
#include <yazproxy/bw.h>
class Yaz_Proxy;
class Msg_Thread;
/// Information Retrieval Proxy Server.
-class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Yaz_Z_Assoc {
+class YAZ_EXPORT Yaz_Proxy : public yazpp_1::Z_Assoc {
friend class Proxy_Msg;
private:
+ char *m_peername;
+ int m_ref_count;
char *get_cookie(Z_OtherInformation **otherInfo);
char *get_proxy(Z_OtherInformation **otherInfo);
void get_charset_and_lang_negotiation(Z_OtherInformation **otherInfo,
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;
- yazpp_1::IYaz_PDU_Observable *m_PDU_Observable;
- yazpp_1::IYazSocketObservable *m_socket_observable;
+ yazpp_1::IPDU_Observable *m_PDU_Observable;
+ yazpp_1::ISocketObservable *m_socket_observable;
Yaz_ProxyClient *m_clientPool;
Yaz_Proxy *m_parent;
int m_seqno;
int m_bytes_sent;
int m_bytes_recv;
int m_bw_max;
+
+ yazpp_1::GDU *m_timeout_gdu;
+ enum timeout_mode {
+ timeout_normal,
+ timeout_reduce,
+ timeout_xsl
+ } m_timeout_mode;
+
Yaz_bw m_bw_stat;
int m_pdu_max;
Yaz_bw m_pdu_stat;
int m_reconfig_flag;
Yaz_ProxyConfig *check_reconfigure();
int m_request_no;
- int m_invalid_session;
+ int m_flag_invalid_session;
YAZ_Proxy_MARCXML_mode m_marcxml_mode;
void *m_stylesheet_xsp; // Really libxslt's xsltStylesheetPtr
int m_stylesheet_offset;
char *m_usemarcon_ini_stage2;
Yaz_usemarcon *m_usemarcon;
Yaz_CharsetConverter *m_charset_converter;
+ yazpp_1::GDUQueue m_in_queue;
public:
- Yaz_Proxy(yazpp_1::IYaz_PDU_Observable *the_PDU_Observable,
- yazpp_1::IYazSocketObservable *the_socket_observable,
+ Yaz_Proxy(yazpp_1::IPDU_Observable *the_PDU_Observable,
+ yazpp_1::ISocketObservable *the_socket_observable,
Yaz_Proxy *parent = 0);
~Yaz_Proxy();
+
+
+ void inc_ref();
+ bool dec_ref();
+
+
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 recv_GDU_reduce(yazpp_1::GDU *gdu);
+ void recv_GDU_normal(yazpp_1::GDU *gdu);
+ void recv_GDU_more();
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
- (yazpp_1::IYaz_PDU_Observable *the_PDU_Observable, int fd);
+ IPDU_Observer *sessionNotify(yazpp_1::IPDU_Observable *the_PDU_Observable,
+ int fd);
void failNotify();
void timeoutNotify();
void connectNotify();