Skip to Content.
Sympa Menu

freetds - [freetds] Timeout for reading from the server doesn't work.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Omar Siam <simar AT gmx.net>
  • To: FreeTDS AT lists.ibiblio.org
  • Subject: [freetds] Timeout for reading from the server doesn't work.
  • Date: Tue, 22 Nov 2005 00:05:03 +0100

Dear list,

I use this great library (libtds) to communicate with MSSQL server on an
embedded system. It's rather important that this system never stops
sending data for a longer period of time. But as far as I could observe
this occurs every time the server becomes unreachable. In both the
stable release and the CVS version a timeout can be set for this case,
but in the stable version this triggers an assertion and in the CVS
version as far as I understand the code it leads to an infinite loop.
For the latter case there is a rather simple fix which makes the
goodread function abort instead of waiting forever. I only insert data
into the database but this has worked reliably now for the last 4 days.

best regards
Omar Siam
Index: src/tds/net.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/tds/net.c,v
retrieving revision 1.34
diff --unified -r1.34 net.c
--- src/tds/net.c	7 Oct 2005 15:07:27 -0000	1.34
+++ src/tds/net.c	21 Nov 2005 23:02:54 -0000
@@ -320,7 +320,7 @@
 			}
 		}
 
-		if (len < 0) {
+		if (len <= 0) {
 			switch(sock_errno) {
 			case TDSSOCK_EINTR:
 				tdsdump_log(TDS_DBG_NETWORK, "socket read interrupted\n");



Archive powered by MHonArc 2.6.24.

Top of Page