Subject Re: [IB-Java] Re: Interserver Win32 Development
Author Mark O'Donohue
ft@... wrote:

> Makefile and patches below. Can you post the makefile you use with
> cygwin.
>
> Fred


Hi Fred

Ive included a unified diff of the changes, since that if often a little
more readable (diff -u).

I've also committed the changes, (I had intended to ask you a few
questions first) but I slipped and commited them first. If we need to
change anything back we can do it fairly easily.

Im also curious about getting the outofmemory exception with
PreparedStatement. Do you have a simple test case that reproduce the
problem? Im using CallableStatements and seem to get a slow memory
leak, but Im not sure if the problem is on the client or server side.
So Im interested in your problem.

Cheers

Mark


Some questions on the changes :

1) --------------------------------
In Error.cpp, I was wonderinf if this should be under a BCC guard, since
perhaps they are required for the MSVC compilation.

+//fredt@...
+// commented out as declarations exist in stdlib.h (bcc32 v.5.5)
+// better include with ifdef where necessary
+//extern int sys_nerr; /* # of error message strings in sys table */
+//extern char *sys_errlist[]; /* the system error message table */
+//end fredt@...



2)-----------------------------------------------

In NetTCP.cpp I also wasn't sure about the following.
I haven't looked too far on these, but they just looked like there may
potentially be a problem. socklen_t should have been defined by
including sys/socket.h. So Iwasn't quite sure where we are leading with
the following but In (mandrake 7.2) its the same as redhat 7.0.

+// fredt@... changed socklen_t type to int
//david jencks 1-19-2001 begin
// int clilen, on;
#ifndef socklen_t //problem on ms compiler
-#define socklen_t size_t //problem on rhlinux 7, socklen_t is uint,
size_t is int
+#define socklen_t int //problem on rhlinux 7, socklen_t is uint,
size_t is int
#endif


3) ------------------------------------------------



--- Full diff file -----------------------------------------------------


Index: CDR.cpp
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/CDR.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 CDR.cpp
--- CDR.cpp 2000/08/03 21:07:43 1.1.1.1
+++ CDR.cpp 2001/04/17 12:31:26
@@ -112,7 +112,18 @@
else
old_realbuf = 0;
oldMessageCertificate = messageCertificate;
+// fredt@... temporary check
+#ifdef TRACEON
+ debugTraceAPointer ("next ", next);
+ debugTraceAPointer ("messageCertificate ", messageCertificate);
+#endif
+/* fredt@...
+ ambiguous comparison of signed and unsigned ( UNIT_MAX is often an
unsigned type )
+ aborts program on first call with next = 16 and messageCertificate = 0
+
assert ((next - messageCertificate) < UINT_MAX);
+*/
+
offset = (unsigned) (next - messageCertificate);

//
Index: CDR.h
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/CDR.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 CDR.h
--- CDR.h 2000/08/03 21:07:44 1.1.1.1
+++ CDR.h 2001/04/17 12:31:26
@@ -24,6 +24,8 @@
#ifdef TRACEON
void debugTraceALine (char* where, char* what);
void debugTraceAnInt (char* where, int what);
+//fredt@... added function
+void debugTraceAPointer (char* where, void* what);
#endif

#ifdef WIN32
@@ -86,7 +88,12 @@
#elif SIZEOF_LONG == 8
typedef long LongLong;
typedef unsigned long ULongLong;
-#elif defined (_MSC_VER) && _MSC_VER >= 900
+//fredt@...
+// brought this in line with other header files to work with bcc32 5.2;
was VC++ specific
+//#elif defined (_MSC_VER) && _MSC_VER >= 900
+#elif (defined(_MSC_VER) && defined(_WIN32)) || \
+ (defined(__BORLANDC__) && (defined(__WIN32__) || defined(__OS2__)))
+//end fredt@...
typedef __int64 LongLong;
typedef unsigned __int64 ULongLong;
#else
Index: Error.cpp
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/Error.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Error.cpp
--- Error.cpp 2000/08/03 21:07:43 1.1.1.1
+++ Error.cpp 2001/04/17 12:31:27
@@ -178,8 +178,12 @@
#endif

#ifndef linux
-extern int sys_nerr; /* # of error message strings in sys table */
-extern char *sys_errlist[]; /* the system error message table */
+//fredt@...
+// commented out as declarations exist in stdlib.h (bcc32 v.5.5)
+// better include with ifdef where necessary
+//extern int sys_nerr; /* # of error message strings in sys table */
+//extern char *sys_errlist[]; /* the system error message table */
+//end fredt@...
#endif

char *
Index: IB_Defines.h
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/IB_Defines.h,v
retrieving revision 1.2
diff -u -r1.2 IB_Defines.h
--- IB_Defines.h 2001/02/03 08:32:30 1.2
+++ IB_Defines.h 2001/04/17 12:31:27
@@ -113,6 +113,8 @@
#ifdef TRACEON
void debugTraceALine (char* where, char* what);
void debugTraceAnInt (char* where, int what);
+//fredt@... added function
+void debugTraceAPointer (char* where, void* what);
#endif

void errorLog (char* what);
Index: JIBSNet.cpp
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/JIBSNet.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 JIBSNet.cpp
--- JIBSNet.cpp 2000/08/03 21:07:49 1.1.1.1
+++ JIBSNet.cpp 2001/04/17 12:31:27
@@ -256,7 +256,10 @@
templen = getLong ();

cdr_.next = cdr_.buffer;
+/* fredt@...
if (!cdr_.buffer) // !!!what is this about?
+*/
+ if (cdr_.buffer == NULL)
cdr_.grow (0);

if (templen > cdr_.length)
Index: NetTCP.cpp
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/NetTCP.cpp,v
retrieving revision 1.3
diff -u -r1.3 NetTCP.cpp
--- NetTCP.cpp 2001/02/18 22:17:27 1.3
+++ NetTCP.cpp 2001/04/17 12:31:32
@@ -142,10 +142,11 @@
NetTCP::netOpen (int sockfd, int *newSockfd, int inetdflag)
{
register int tmpSockfd, childpid;
+// fredt@... changed socklen_t type to int
//david jencks 1-19-2001 begin
// int clilen, on;
#ifndef socklen_t //problem on ms compiler
-#define socklen_t size_t //problem on rhlinux 7, socklen_t is uint,
size_t is int
+#define socklen_t int //problem on rhlinux 7, socklen_t is uint,
size_t is int
#endif
int on;
socklen_t clilen;
Index: interserver.cpp
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/interserver/interserver.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 interserver.cpp
--- interserver.cpp 2000/08/03 21:07:54 1.1.1.1
+++ interserver.cpp 2001/04/17 12:31:32
@@ -94,6 +94,16 @@
fflush (traceStream__);
}
}
+//fredt@... added function
+void debugTraceAPointer (char* where, void* what)
+{
+ if (!traceStream__)
+ traceStream__ = fopen ("debug.log", "w");
+ if (traceStream__) {
+ fprintf (traceStream__, "%s %p\n", where, what);
+ fflush (traceStream__);
+ }
+}
#endif

// Notice we do not depend on JIBSNet





--
Your database needs YOU!
http://firebird.sourceforge.net