Skip to Content.
Sympa Menu

freetds - [freetds] Misc fixes

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Peter Deacon <peterd AT iea-software.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Misc fixes
  • Date: Mon, 31 Mar 2003 17:33:47 -0800 (Pacific Standard Time)

pid.diff sends correct process ids /w TDS 7+.
crt.diff adds MS runtime bonds/memory accounting for debug versions.

Have Fun!
Peterdiff -u ./login.c n:\freetds\src\tds\/login.c
--- ./login.c 2003-03-31 15:16:21.000000000 -0800
+++ n:\freetds\src\tds\/login.c 2003-03-13 02:08:25.000000000 -0800
@@ -644,8 +644,8 @@
tds7_send_login(TDSSOCKET * tds, TDSCONNECTINFO * connect_info)
{
int rc;
- static const unsigned char magic1_domain[] = {
- 0x0, 0x0, 0x0, /* Unknown ? */
+ static const unsigned char magic1_domain[] = { 6, 0x7d, 0x0f, 0xfd,
+ 0xff, 0x0, 0x0, 0x0, /* Client PID */
/* the 0x80 in the third byte controls whether this is a
domain login
* or not 0x80 = yes, 0x00 = no */
0x0, 0xe0, 0x83, 0x0, /* Connection ID of the Primary
Server (?) */
@@ -656,8 +656,8 @@
0x00, 0x09, 0x04, 0x00,
0x00
};
- static const unsigned char magic1_server[] = {
- 0x0, 0x0, 0x0, /* Unknown ? */
+ static const unsigned char magic1_server[] = { 6, 0x83, 0xf2, 0xf8,
/* Client Program version */
+ 0xff, 0x0, 0x0, 0x0, /* Client PID */
0x0, 0xe0, 0x03, 0x0, /* Connection ID of the Primary
Server (?) */
0x0, /* Option Flags 1 */
0x88, /* Option Flags 2 */
@@ -688,8 +688,7 @@
int language_len = connect_info->language ?
strlen(connect_info->language) : 0;
int database_len = connect_info->database ?
strlen(connect_info->database) : 0;
int domain_len = domain ? strlen(domain) : 0;
- int auth_len = 0;
- const char magic_start = 6; /* Client Program version */
+ int auth_len = 0;

/* avoid overflow limiting password */
if (password_len > 128)
@@ -722,11 +721,8 @@
tds_put_byte(tds, 0x70);
}
tds_put_n(tds, NULL, 3); /* rest of TDSVersion which is a 4
byte field */
- tds_put_n(tds, NULL, 4); /* desired packet size being
requested by client */
-
- tds_put_n(tds,&magic_start,1);
- tds_put_int(tds,getpid());
- tds_put_n(tds,magic1,16);
+ tds_put_n(tds, NULL, 4); /* desired packet size being
requested by client */
+ tds_put_n(tds, magic1, 21);

current_pos = 86; /* ? */
/* host name */
Only in .: pid.diff
Common subdirectories: ./unittests and n:\freetds\src\tds\/unittests
diff -u ./write.c n:\freetds\src\tds\/write.c
--- ./write.c 2003-03-31 14:26:37.000000000 -0800
+++ n:\freetds\src\tds\/write.c 2003-02-13 13:25:13.000000000 -0800
@@ -77,7 +77,7 @@
tds_put_n(TDSSOCKET * tds, const void *buf, int n)
{
int i;
- const unsigned char *bufp = (const unsigned char *) buf;
+ const unsigned char *bufp = (const unsigned char *) buf;

if (bufp) {
for (i = 0; i < n; i++)
Only in .: crt.diff
Common subdirectories: ./dev-cpp and n:\freetds\win32/dev-cpp
diff -u ./initnet.c n:\freetds\win32/initnet.c
--- ./initnet.c 2003-03-31 15:31:31.000000000 -0800
+++ n:\freetds\win32/initnet.c 2003-02-21 01:42:34.000000000 -0800
@@ -1,38 +1,14 @@
#include <windows.h>

-#ifdef _DEBUG
-#include <crtdbg.h>
-#endif
-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
WSADATA wsaData;

switch(fdwReason) {
case DLL_PROCESS_ATTACH:
-
-#ifdef _DEBUG
- _CrtSetReportMode(_CRT_WARN,_CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_WARN,_CRTDBG_FILE_STDOUT);
- _CrtSetReportMode(_CRT_ERROR,_CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ERROR,_CRTDBG_FILE_STDOUT);
- _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE);
- _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDOUT);
-
_CrtSetDbgFlag(_CRTDBG_CHECK_ALWAYS_DF|_CRTDBG_LEAK_CHECK_DF|_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
-#endif
-
-
if (WSAStartup( MAKEWORD( 1, 1 ), &wsaData ) != 0)
return FALSE;
break;
-
- case DLL_PROCESS_DETACH:
-#ifdef _DEBUG
- _CrtDumpMemoryLeaks();
-#endif
- break;
-
-
}
return TRUE;
}
\ No newline at end of file
Common subdirectories: ./msvc6 and n:\freetds\win32/msvc6



Archive powered by MHonArc 2.6.24.

Top of Page