-/* $Id: proxy.h,v 1.18 2005-06-02 06:40:46 adam Exp $
+/* $Id: proxy.h,v 1.19 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the 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 *get_cookie(Z_OtherInformation **otherInfo);
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;
Yaz_usemarcon *m_usemarcon;
Yaz_CharsetConverter *m_charset_converter;
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();
int handle_authentication(Z_APDU *apdu);
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();
-/* $Id: msg-thread.cpp,v 1.2 2005-06-02 06:40:46 adam Exp $
+/* $Id: msg-thread.cpp,v 1.3 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
}
-Msg_Thread::Msg_Thread(IYazSocketObservable *obs)
+Msg_Thread::Msg_Thread(ISocketObservable *obs)
: m_SocketObservable(obs)
{
pipe(m_fd);
obs->addObserver(m_fd[0], this);
- obs->maskObserver(this, YAZ_SOCKET_OBSERVE_READ);
+ obs->maskObserver(this, SOCKET_OBSERVE_READ);
m_stop_flag = false;
pthread_mutex_init(&m_mutex_input_data, 0);
void Msg_Thread::socketNotify(int event)
{
- if (event & YAZ_SOCKET_OBSERVE_READ)
+ if (event & SOCKET_OBSERVE_READ)
{
char buf[2];
read(m_fd[0], buf, 1);
-/* $Id: msg-thread.h,v 1.2 2005-06-02 06:40:46 adam Exp $
+/* $Id: msg-thread.h,v 1.3 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
Msg_Thread_Queue_List *m_list;
};
-class Msg_Thread : public yazpp_1::IYazSocketObserver {
+class Msg_Thread : public yazpp_1::ISocketObserver {
public:
- Msg_Thread(yazpp_1::IYazSocketObservable *obs);
+ Msg_Thread(yazpp_1::ISocketObservable *obs);
virtual ~Msg_Thread();
void socketNotify(int event);
void put(IMsg_Thread *m);
void run(void *p);
int m_fd[2];
private:
- yazpp_1::IYazSocketObservable *m_SocketObservable;
+ yazpp_1::ISocketObservable *m_SocketObservable;
pthread_t m_thread_id;
Msg_Thread_Queue m_input;
Msg_Thread_Queue m_output;
-/* $Id: proxyp.h,v 1.6 2005-06-02 06:40:46 adam Exp $
+/* $Id: proxyp.h,v 1.7 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
class Yaz_ProxyConfigP *m_cp;
};
-class Yaz_ProxyClient : public yazpp_1::Yaz_Z_Assoc {
+class Yaz_ProxyClient : public yazpp_1::Z_Assoc {
friend class Yaz_Proxy;
- Yaz_ProxyClient(yazpp_1::IYaz_PDU_Observable *the_PDU_Observable,
+ Yaz_ProxyClient(yazpp_1::IPDU_Observable *the_PDU_Observable,
Yaz_Proxy *parent);
~Yaz_ProxyClient();
void recv_GDU(Z_GDU *apdu, int len);
void recv_Z_PDU(Z_APDU *apdu, int len);
void recv_HTTP_response(Z_HTTP_Response *apdu, int len);
- 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 shutdown();
Yaz_Proxy *m_server;
void failNotify();
Z_ProtocolVersion *m_initResponse_version;
int m_initResponse_preferredMessageSize;
int m_initResponse_maximumRecordSize;
- yazpp_1::Yaz_RecordCache m_cache;
+ yazpp_1::RecordCache m_cache;
void pre_init_client();
int m_target_idletime;
Yaz_Proxy *m_root;
-/* $Id: tstthreads.cpp,v 1.4 2005-06-02 06:40:46 adam Exp $
+/* $Id: tstthreads.cpp,v 1.5 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
printf("My_Msg::result val=%d\n", m_val);
}
-class My_Timer_Thread : public IYazSocketObserver {
+class My_Timer_Thread : public ISocketObserver {
private:
- IYazSocketObservable *m_obs;
+ ISocketObservable *m_obs;
int m_fd[2];
Msg_Thread *m_t;
public:
- My_Timer_Thread(IYazSocketObservable *obs, Msg_Thread *t);
+ My_Timer_Thread(ISocketObservable *obs, Msg_Thread *t);
void socketNotify(int event);
};
-My_Timer_Thread::My_Timer_Thread(IYazSocketObservable *obs,
+My_Timer_Thread::My_Timer_Thread(ISocketObservable *obs,
Msg_Thread *t) : m_obs(obs)
{
pipe(m_fd);
m_t = t;
obs->addObserver(m_fd[0], this);
- obs->maskObserver(this, YAZ_SOCKET_OBSERVE_READ);
+ obs->maskObserver(this, SOCKET_OBSERVE_READ);
obs->timeoutObserver(this, 2);
}
int main(int argc, char **argv)
{
- Yaz_SocketManager mySocketManager;
+ SocketManager mySocketManager;
Msg_Thread m(&mySocketManager);
My_Timer_Thread t(&mySocketManager, &m) ;
-/* $Id: yaz-proxy-main.cpp,v 1.14 2005-06-02 06:40:46 adam Exp $
+/* $Id: yaz-proxy-main.cpp,v 1.15 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
}
#endif
-static void child_run(Yaz_SocketManager *m, int run)
+static void child_run(SocketManager *m, int run)
{
#ifdef WIN32
#else
#endif
int cont = 1;
int run = 1;
- Yaz_SocketManager mySocketManager;
- Yaz_Proxy proxy(new Yaz_PDU_Assoc(&mySocketManager), &mySocketManager);
+ SocketManager mySocketManager;
+ Yaz_Proxy proxy(new PDU_Assoc(&mySocketManager), &mySocketManager);
static_yaz_proxy = &proxy;
-/* $Id: yaz-proxy.cpp,v 1.29 2005-06-02 06:40:46 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.30 2005-06-08 13:29:03 adam Exp $
Copyright (c) 1998-2005, Index Data.
This file is part of the yaz-proxy.
return "Unknown request/response";
}
-Yaz_Proxy::Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable,
- IYazSocketObservable *the_socket_observable,
+Yaz_Proxy::Yaz_Proxy(IPDU_Observable *the_PDU_Observable,
+ ISocketObservable *the_socket_observable,
Yaz_Proxy *parent)
:
- Yaz_Z_Assoc(the_PDU_Observable), m_bw_stat(60), m_pdu_stat(60)
+ Z_Assoc(the_PDU_Observable), m_bw_stat(60), m_pdu_stat(60)
{
m_PDU_Observable = the_PDU_Observable;
m_socket_observable = the_socket_observable;
return cfg;
}
-IYaz_PDU_Observer *Yaz_Proxy::sessionNotify(IYaz_PDU_Observable
- *the_PDU_Observable, int fd)
+IPDU_Observer *Yaz_Proxy::sessionNotify(IPDU_Observable
+ *the_PDU_Observable, int fd)
{
check_reconfigure();
Yaz_Proxy *new_proxy = new Yaz_Proxy(the_PDU_Observable,
pre_init_client();
}
-IYaz_PDU_Observer *Yaz_ProxyClient::sessionNotify(IYaz_PDU_Observable
- *the_PDU_Observable, int fd)
+IPDU_Observer *Yaz_ProxyClient::sessionNotify(IPDU_Observable
+ *the_PDU_Observable, int fd)
{
return new Yaz_ProxyClient(the_PDU_Observable, 0);
}
shutdown();
}
-Yaz_ProxyClient::Yaz_ProxyClient(IYaz_PDU_Observable *the_PDU_Observable,
+Yaz_ProxyClient::Yaz_ProxyClient(IPDU_Observable *the_PDU_Observable,
Yaz_Proxy *parent) :
- Yaz_Z_Assoc (the_PDU_Observable)
+ Z_Assoc (the_PDU_Observable)
{
m_cookie = 0;
m_next = 0;
int Yaz_Proxy::server(const char *addr)
{
- int r = Yaz_Z_Assoc::server(addr);
+ int r = Z_Assoc::server(addr);
if (!r)
{
yaz_log(YLOG_LOG, "%sStarted proxy "