projects
/
yazpp-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b200a15
)
WIN32 updates
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 30 Mar 2004 18:14:13 +0000
(18:14 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 30 Mar 2004 18:14:13 +0000
(18:14 +0000)
include/yaz++/proxy/proxy.h
patch
|
blob
|
history
proxy/yaz-proxy-main.cpp
patch
|
blob
|
history
proxy/yaz-proxy.cpp
patch
|
blob
|
history
src/yaz-ir-assoc.cpp
patch
|
blob
|
history
src/yaz-z-server.cpp
patch
|
blob
|
history
win/makefile
patch
|
blob
|
history
diff --git
a/include/yaz++/proxy/proxy.h
b/include/yaz++/proxy/proxy.h
index
06b33e4
..
764be3d
100644
(file)
--- a/
include/yaz++/proxy/proxy.h
+++ b/
include/yaz++/proxy/proxy.h
@@
-1,4
+1,4
@@
-/* $Id: proxy.h,v 1.2 2004-03-30 09:05:53 adam Exp $
+/* $Id: proxy.h,v 1.3 2004-03-30 18:14:13 adam Exp $
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
@@
-19,7
+19,9
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
02111-1307, USA.
*/
+#if HAVE_GETTIMEOFDAY
#include <sys/time.h>
#include <sys/time.h>
+#endif
#include <yaz++/z-assoc.h>
#include <yaz++/z-query.h>
#include <yaz++/z-databases.h>
#include <yaz++/z-assoc.h>
#include <yaz++/z-query.h>
#include <yaz++/z-databases.h>
@@
-277,7
+279,9
@@
class YAZ_EXPORT Yaz_Proxy : public Yaz_Z_Assoc {
int m_http_keepalive;
const char *m_http_version;
Yaz_cql2rpn m_cql2rpn;
int m_http_keepalive;
const char *m_http_version;
Yaz_cql2rpn m_cql2rpn;
+#if HAVE_GETTIMEOFDAY
struct timeval m_time_tv;
struct timeval m_time_tv;
+#endif
void logtime();
Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema);
Z_ReferenceId *m_referenceId;
void logtime();
Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema);
Z_ReferenceId *m_referenceId;
diff --git
a/proxy/yaz-proxy-main.cpp
b/proxy/yaz-proxy-main.cpp
index
645dc8b
..
fece3b3
100644
(file)
--- a/
proxy/yaz-proxy-main.cpp
+++ b/
proxy/yaz-proxy-main.cpp
@@
-1,4
+1,4
@@
-/* $Id: yaz-proxy-main.cpp,v 1.1 2004-03-29 22:48:31 adam Exp $
+/* $Id: yaz-proxy-main.cpp,v 1.2 2004-03-30 18:14:13 adam Exp $
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
@@
-19,10
+19,14
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
02111-1307, USA.
*/
+#ifdef WIN32
+#else
#include <signal.h>
#include <unistd.h>
#include <pwd.h>
#include <signal.h>
#include <unistd.h>
#include <pwd.h>
+#endif
#include <sys/types.h>
#include <sys/types.h>
+
#include <stdarg.h>
#if HAVE_GETRLIMIT
#include <stdarg.h>
#if HAVE_GETRLIMIT
@@
-150,7
+154,10
@@
int args(Yaz_Proxy *proxy, int argc, char **argv)
static Yaz_Proxy *static_yaz_proxy = 0;
static void sighup_handler(int num)
{
static Yaz_Proxy *static_yaz_proxy = 0;
static void sighup_handler(int num)
{
+#if WIN32
+#else
signal(SIGHUP, sighup_handler);
signal(SIGHUP, sighup_handler);
+#endif
if (static_yaz_proxy)
static_yaz_proxy->reconfig();
}
if (static_yaz_proxy)
static_yaz_proxy->reconfig();
}
@@
-163,8
+170,11
@@
static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
va_list ap;
va_start(ap, fmt);
+#ifdef WIN32
+ vsprintf(buf, fmt, ap);
+#else
vsnprintf(buf, sizeof(buf), fmt, ap);
vsnprintf(buf, sizeof(buf), fmt, ap);
-
+#endif
yaz_log(LOG_WARN, "%s: %s", (char*) ctx, buf);
va_end (ap);
yaz_log(LOG_WARN, "%s: %s", (char*) ctx, buf);
va_end (ap);
@@
-173,14
+183,19
@@
static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
static void child_run(Yaz_SocketManager *m, int run)
{
static void child_run(Yaz_SocketManager *m, int run)
{
+#ifdef WIN32
+#else
signal(SIGHUP, sighup_handler);
signal(SIGHUP, sighup_handler);
+#endif
#if HAVE_XSLT
xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
#endif
#if HAVE_XSLT
xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
#endif
+#ifdef WIN32
+#else
yaz_log(LOG_LOG, "0 proxy run=%d pid=%ld", run, (long) getpid());
yaz_log(LOG_LOG, "0 proxy run=%d pid=%ld", run, (long) getpid());
-
+#endif
if (no_limit_files)
{
#if HAVE_SETRLIMIT
if (no_limit_files)
{
#if HAVE_SETRLIMIT
@@
-196,6
+211,8
@@
static void child_run(Yaz_SocketManager *m, int run)
yaz_log(LOG_WARN, "setrlimit unavablable. Option -n ignored");
#endif
}
yaz_log(LOG_WARN, "setrlimit unavablable. Option -n ignored");
#endif
}
+#ifdef WIN32
+#else
if (pid_fname)
{
FILE *f = fopen(pid_fname, "w");
if (pid_fname)
{
FILE *f = fopen(pid_fname, "w");
@@
-229,6
+246,7
@@
static void child_run(Yaz_SocketManager *m, int run)
}
xfree(uid);
}
}
xfree(uid);
}
+#endif
#if HAVE_GETRLIMIT
struct rlimit limit_data;
getrlimit(RLIMIT_NOFILE, &limit_data);
#if HAVE_GETRLIMIT
struct rlimit limit_data;
getrlimit(RLIMIT_NOFILE, &limit_data);
@@
-258,6
+276,9
@@
int main(int argc, char **argv)
args(&proxy, argc, argv);
args(&proxy, argc, argv);
+#ifdef WIN32
+ child_run(&mySocketManager, run);
+#else
if (debug)
{
child_run(&mySocketManager, run);
if (debug)
{
child_run(&mySocketManager, run);
@@
-327,6
+348,7
@@
int main(int argc, char **argv)
sleep(1 + run/5);
run++;
}
sleep(1 + run/5);
run++;
}
+#endif
exit (0);
return 0;
}
exit (0);
return 0;
}
diff --git
a/proxy/yaz-proxy.cpp
b/proxy/yaz-proxy.cpp
index
25cd9c2
..
c4db080
100644
(file)
--- a/
proxy/yaz-proxy.cpp
+++ b/
proxy/yaz-proxy.cpp
@@
-1,4
+1,4
@@
-/* $Id: yaz-proxy.cpp,v 1.3 2004-03-30 14:25:41 adam Exp $
+/* $Id: yaz-proxy.cpp,v 1.4 2004-03-30 18:14:13 adam Exp $
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
Copyright (c) 1998-2004, Index Data.
This file is part of the yaz-proxy.
@@
-19,7
+19,11
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
02111-1307, USA.
*/
+#ifdef WIN32
+#else
#include <unistd.h>
#include <unistd.h>
+#endif
+
#include <assert.h>
#include <time.h>
#include <sys/types.h>
#include <assert.h>
#include <time.h>
#include <sys/types.h>
@@
-143,8
+147,10
@@
Yaz_Proxy::Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable,
m_http_version = 0;
m_soap_ns = 0;
m_s2z_packing = Z_SRW_recordPacking_string;
m_http_version = 0;
m_soap_ns = 0;
m_s2z_packing = Z_SRW_recordPacking_string;
+#if HAVE_GETTIMEOFDAY
m_time_tv.tv_sec = 0;
m_time_tv.tv_usec = 0;
m_time_tv.tv_sec = 0;
m_time_tv.tv_usec = 0;
+#endif
if (!m_parent)
low_socket_open();
}
if (!m_parent)
low_socket_open();
}
@@
-737,6
+743,7
@@
void Yaz_Proxy::convert_to_marcxml(Z_NamePlusRecordList *p)
void Yaz_Proxy::logtime()
{
void Yaz_Proxy::logtime()
{
+#if HAVE_GETTIMEOFDAY
if (m_time_tv.tv_sec)
{
struct timeval tv;
if (m_time_tv.tv_sec)
{
struct timeval tv;
@@
-749,6
+756,7
@@
void Yaz_Proxy::logtime()
}
m_time_tv.tv_sec = 0;
m_time_tv.tv_usec = 0;
}
m_time_tv.tv_sec = 0;
m_time_tv.tv_usec = 0;
+#endif
}
int Yaz_Proxy::send_http_response(int code)
}
int Yaz_Proxy::send_http_response(int code)
@@
-1399,7
+1407,9
@@
void Yaz_Proxy::recv_GDU(Z_GDU *apdu, int len)
m_bw_stat.add_bytes(len);
m_pdu_stat.add_bytes(1);
m_bw_stat.add_bytes(len);
m_pdu_stat.add_bytes(1);
+#if HAVE_GETTIMEOFDAY
gettimeofday(&m_time_tv, 0);
gettimeofday(&m_time_tv, 0);
+#endif
int bw_total = m_bw_stat.get_total();
int pdu_total = m_pdu_stat.get_total();
int bw_total = m_bw_stat.get_total();
int pdu_total = m_pdu_stat.get_total();
@@
-2571,17
+2581,23
@@
void Yaz_ProxyClient::recv_Z_PDU(Z_APDU *apdu, int len)
void Yaz_Proxy::low_socket_close()
{
void Yaz_Proxy::low_socket_close()
{
+#if WIN32
+#else
int i;
for (i = 0; i<NO_SPARE_SOLARIS_FD; i++)
if (m_lo_fd[i] >= 0)
::close(m_lo_fd[i]);
int i;
for (i = 0; i<NO_SPARE_SOLARIS_FD; i++)
if (m_lo_fd[i] >= 0)
::close(m_lo_fd[i]);
+#endif
}
void Yaz_Proxy::low_socket_open()
{
}
void Yaz_Proxy::low_socket_open()
{
+#if WIN32
+#else
int i;
for (i = 0; i<NO_SPARE_SOLARIS_FD; i++)
m_lo_fd[i] = open("/dev/null", O_RDONLY);
int i;
for (i = 0; i<NO_SPARE_SOLARIS_FD; i++)
m_lo_fd[i] = open("/dev/null", O_RDONLY);
+#endif
}
int Yaz_Proxy::server(const char *addr)
}
int Yaz_Proxy::server(const char *addr)
@@
-2589,7
+2605,11
@@
int Yaz_Proxy::server(const char *addr)
int r = Yaz_Z_Assoc::server(addr);
if (!r)
{
int r = Yaz_Z_Assoc::server(addr);
if (!r)
{
- yaz_log(LOG_LOG, "%sStarted proxy " VERSION " on %s", m_session_str, addr);
+ yaz_log(LOG_LOG, "%sStarted proxy "
+#ifdef VERSION
+ VERSION
+#endif
+ " on %s", m_session_str, addr);
timeout(1);
}
return r;
timeout(1);
}
return r;
diff --git
a/src/yaz-ir-assoc.cpp
b/src/yaz-ir-assoc.cpp
index
d5edf86
..
ace54d5
100644
(file)
--- a/
src/yaz-ir-assoc.cpp
+++ b/
src/yaz-ir-assoc.cpp
@@
-2,7
+2,7
@@
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-ir-assoc.cpp,v 1.20 2003-12-16 14:17:01 adam Exp $
+ * $Id: yaz-ir-assoc.cpp,v 1.21 2004-03-30 18:14:13 adam Exp $
*/
#include <assert.h>
*/
#include <assert.h>
@@
-153,7
+153,7
@@
void Yaz_IR_Assoc::get_elementSetName (const char **elementSetName)
void Yaz_IR_Assoc::recv_GDU(Z_GDU *apdu, int len)
{
if (apdu->which == Z_GDU_Z3950)
void Yaz_IR_Assoc::recv_GDU(Z_GDU *apdu, int len)
{
if (apdu->which == Z_GDU_Z3950)
- return recv_Z_PDU(apdu->u.z3950, len);
+ recv_Z_PDU(apdu->u.z3950, len);
}
void Yaz_IR_Assoc::recv_Z_PDU(Z_APDU *apdu, int len)
}
void Yaz_IR_Assoc::recv_Z_PDU(Z_APDU *apdu, int len)
diff --git
a/src/yaz-z-server.cpp
b/src/yaz-z-server.cpp
index
99ef2db
..
cc78d55
100644
(file)
--- a/
src/yaz-z-server.cpp
+++ b/
src/yaz-z-server.cpp
@@
-2,7
+2,7
@@
* Copyright (c) 2000-2003, Index Data.
* See the file LICENSE for details.
*
* Copyright (c) 2000-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-server.cpp,v 1.17 2003-12-16 14:17:01 adam Exp $
+ * $Id: yaz-z-server.cpp,v 1.18 2004-03-30 18:14:13 adam Exp $
*/
#include <yaz/log.h>
*/
#include <yaz/log.h>
@@
-51,7
+51,7
@@
void Yaz_Z_Server::facility_add(IYaz_Server_Facility *facility,
void Yaz_Z_Server::recv_GDU (Z_GDU *apdu, int len)
{
if (apdu->which == Z_GDU_Z3950)
void Yaz_Z_Server::recv_GDU (Z_GDU *apdu, int len)
{
if (apdu->which == Z_GDU_Z3950)
- return recv_Z_PDU(apdu->u.z3950, len);
+ recv_Z_PDU(apdu->u.z3950, len);
else
delete this;
}
else
delete this;
}
diff --git
a/win/makefile
b/win/makefile
index
bff38de
..
4964865
100644
(file)
--- a/
win/makefile
+++ b/
win/makefile
@@
-1,6
+1,6
@@
# Copyright (C) 1993-2004, Index Data ApS
# All rights reserved.
# Copyright (C) 1993-2004, Index Data ApS
# All rights reserved.
-# $Id: makefile,v 1.1 2004-03-30 17:42:25 adam Exp $
+# $Id: makefile,v 1.2 2004-03-30 18:14:14 adam Exp $
###########################################################
############### Parameters
###########################################################
############### Parameters
@@
-31,7
+31,7
@@
ZLIB_DIR = c:\zlib-1.1.4.win32
default: all
default: all
-all: dirs dll proxy iconv libxml2 libxslt
+all: dirs dll proxy iconv libxml2 libxslt yaz
NSIS="c:\program files\nsis\makensis-bz2.exe"
NSIS="c:\program files\nsis\makensis-bz2.exe"
@@
-81,6
+81,10
@@
proxy: $(YAZPROXY)
YAZ_LIB="$(YAZ_DIR)\lib\yaz.lib"
YAZ_DEF=/I"$(YAZ_DIR)\include"
YAZ_LIB="$(YAZ_DIR)\lib\yaz.lib"
YAZ_DEF=/I"$(YAZ_DIR)\include"
+yaz: $(BINDIR)\yaz.dll $(BINDIR)\yaz.dll
+
+$(BINDIR)\yaz.dll: $(YAZ_DIR)\bin\yaz.dll
+ copy "$(YAZ_DIR)\bin\yaz.dll" $(BINDIR)
!if $(HAVE_ICONV)
ICONV_DEF= \
!if $(HAVE_ICONV)
ICONV_DEF= \
@@
-240,7
+244,7
@@
YAZPP_DLL_OBJS = \
YAZPROXY_DLL_OBJS = \
"$(OBJDIR)\yaz-proxy.obj" \
"$(OBJDIR)\yaz-proxy-config.obj" \
YAZPROXY_DLL_OBJS = \
"$(OBJDIR)\yaz-proxy.obj" \
"$(OBJDIR)\yaz-proxy-config.obj" \
- "$(OBJDIR)\yaz-bw.obj
+ "$(OBJDIR)\yaz-bw.obj"
###########################################################
############### Compiling
###########################################################
############### Compiling
@@
-294,16
+298,17
@@
$(YAZPP_DLL) $(YAZPP_IMPLIB): "$(BINDIR)" $(YAZPP_DLL_OBJS)
$(DLL_LINK_OPTIONS)
$(YAZPP_DLL_OBJS)
/out:"$(YAZPP_DLL)"
$(DLL_LINK_OPTIONS)
$(YAZPP_DLL_OBJS)
/out:"$(YAZPP_DLL)"
- /implib:$(YAZPP_IMPLIB)
+ /implib:"$(YAZPP_IMPLIB)"
/map:"$(LIBDIR)\yazpp.map"
<<
/map:"$(LIBDIR)\yazpp.map"
<<
-$(YAZPROXY_DLL) $(YAZPROXY_IMPLIB): "$(BINDIR)" $(YAZPROXY_DLL_OBJS)
+$(YAZPROXY_DLL) $(YAZPROXY_IMPLIB): "$(BINDIR)" $(YAZPROXY_DLL_OBJS) $(YAZPP_IMPLIB)
@echo Linking $(YAZPROXY_DLL)
$(LINK) @<<
$(LNKOPT)
$(LINK_LIBS)
$(DLL_LINK_OPTIONS)
@echo Linking $(YAZPROXY_DLL)
$(LINK) @<<
$(LNKOPT)
$(LINK_LIBS)
$(DLL_LINK_OPTIONS)
+ $(YAZPP_IMPLIB)
$(YAZPROXY_DLL_OBJS)
/out:$(YAZPROXY_DLL)
/implib:"$(YAZPROXY_IMPLIB)"
$(YAZPROXY_DLL_OBJS)
/out:$(YAZPROXY_DLL)
/implib:"$(YAZPROXY_IMPLIB)"