Skip to Content.
Sympa Menu

freetds - Re: [freetds] Issue connecting to SQL Server from LinuxHostwithnewerversions of FreeTDS...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Glenn, Chris" <Glenn AT addsys.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Issue connecting to SQL Server from LinuxHostwithnewerversions of FreeTDS...
  • Date: Tue, 28 Nov 2006 12:58:35 -0500

PS.
------------------------------------------------------------------
This is what my code in the net.c file looks like;
------------------------------------------------------------------
...
(void)memset(&sin, 0, sizeof(sin)); /* CG - ADD */
FD_ZERO(&fds);

size_t msg_len; /* CG - ADD */
int port = 0; /* CG - ADD */

(void)memset(&sin, 0, sizeof(sin)); /* CG - ADD */

sin.sin_addr.s_addr = inet_addr(ip_addr);
if (sin.sin_addr.s_addr == INADDR_NONE) {
...
------------------------------------------------------------------
And here is the log output;
------------------------------------------------------------------

util.c:292:Starting log file for FreeTDS 0.65.dev.20061128
on 2006-11-28 11:59:30 with debug flags 0x4fff.
iconv.c:195:names for ISO-8859-1: ISO-8859-1
iconv.c:195:names for UTF-8: UTF-8
iconv.c:195:names for UCS-2LE: UCS-2LE
iconv.c:195:names for UCS-2BE: UCS-2BE
iconv.c:361:iconv to convert client-side data to the "ANSI_X3.4-1968"
character
set
iconv.c:514:tds_iconv_info_init: converting "US-ASCII"->"UCS-2LE"
iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
net.c:190:Connecting to 10.3.2.40 port 0 (TDS version 7.0)
net.c:245:error: connect(2) returned 0x73, "Operation now in progress"
net.c:247:Contents of sockaddr_in
0000 02 00 00 00 0a 03 02 28-00 00 00 00 00 00 00 00 |.......( ........|

net.c:248: sockaddr_in:
sin_family = 2
sin_port = 0
sin_addr.s_addr = 2802030a
(param ip_addr) = '10.3.2.40'
net.c:278:tds_open_socket: 10.3.2.40:0: Invalid argument
util.c:120:Changing query state from IDLE to DEAD
token.c:2221:tds_client_msg: #20003: "SQL Server connection timed out.".
Connec
tion state is now 4.
mem.c:565:tds_free_all_results()



Thanks for you help!

Chris

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Christos Zoulas
Sent: Tuesday, November 28, 2006 10:20 AM
To: FreeTDS Development Group
Subject: Re: [freetds] Issue connecting to SQL Server from
LinuxHostwithnewerversions of FreeTDS...

On Nov 28, 9:20am, Glenn AT addsys.com ("Glenn, Chris") wrote:
-- Subject: Re: [freetds] Issue connecting to SQL Server from Linux
Hostwithn

| If you can tell me specifically where in the net.c source this line
| should be added, I can try it right away.
|
| Thanks-
| Chris Glenn

This is a patch for my version of net.c

christos

Index: net.c
===================================================================
RCS file: /src/twosigma/cvsroot/external/public/freetds/src/tds/net.c,v
retrieving revision 1.1.1.3
diff -u -u -r1.1.1.3 net.c
--- net.c 24 Apr 2006 21:10:42 -0000 1.1.1.3
+++ net.c 28 Nov 2006 15:19:10 -0000
@@ -154,6 +154,7 @@
socklen_t optlen;
#endif

+ (void)memset(&sin, 0, sizeof(sin));
FD_ZERO(&fds);

sin.sin_addr.s_addr = inet_addr(ip_addr);
@@ -723,6 +724,7 @@
size_t msg_len;
int port = 0;

+ (void)memset(&sin, 0, sizeof(sin));
sin.sin_addr.s_addr = inet_addr(ip_addr);
if (sin.sin_addr.s_addr == INADDR_NONE) {
tdsdump_log(TDS_DBG_ERROR, "inet_addr() failed, IP =
%s\n", ip_addr);
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page