X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A25C2DA58E for ; Fri, 7 Oct 2005 19:13:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60811-04 for ; Fri, 7 Oct 2005 22:13:16 +0000 (GMT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by svr1.postgresql.org (Postfix) with ESMTP id 3937CDA594 for ; Fri, 7 Oct 2005 19:13:17 -0300 (ADT) Received: from mailgate.vale-housing.co.uk ([194.217.48.34] helo=vale-housing.co.uk) by anchor-post-30.mail.demon.net with esmtp (Exim 4.42) id 1EO0St-0002Ey-2X for pgsql-odbc@postgresql.org; Fri, 07 Oct 2005 22:13:19 +0000 Received: from 192.168.1.106 ([192.168.1.106]) by ratbert.vale-housing.co.uk ([192.168.1.106]) with Microsoft Exchange Server HTTP-DAV ; Fri, 7 Oct 2005 22:13:19 +0000 From: "Dave Page" To: , Subject: Re: app crashes if lost connection during query, seems to be a bug. Message-ID: <028c01c5cb8c$53077ec2$6a01a8c0@valehousing.co.uk> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 7 Oct 2005 23:13:11 +0100 MIME-Version: 1.0 thread-topic: [ODBC] app crashes if lost connection during query, seems to be a bug. thread-index: AcXLjFMHvn9G767QQnq8QsX1PZU5gQ== X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.603 required=5 tests=[AWL=-1.473, MSGID_DOLLARS=3.076] X-Spam-Level: * X-Archive-Number: 200510/29 X-Sequence-Number: 6131 The SOCK_* code is all gone in the current code which uses libpq = instead. I have actually tested the server shutdown case and the driver = handled it as it should. Regards, Dave =20 -----Original Message----- From: "doggie tame" Sent: 07/10/05 22:32:19 To: "pgsql-odbc@postgresql.org" Subject: [ODBC] app crashes if lost connection during query, seems to be = a bug. hi, there application crashes if lost connection during query (such as server is shuted down in immediate mode). it's due to that after connection closed, the socket flush funciton, SOCK_flush_output, is still trying to write/flush to the non-exist socket, during the socket destruction stage. the socket should be marked as "CLOSED" when connection is lost, such as, in socket.c UCHAR SOCK_get_next_byte(SocketClass *self) { ....... if (self->buffer_filled_in =3D=3D 0) { self->errornumber =3D SOCKET_CLOSED; self->errormsg =3D "Socket has been closed."; self->buffer_filled_in =3D 0; self->socket=3D-1; //@mark the socket "CLOSED"! return 0; } } return self->buffer_in[self->buffer_read_in++]; } =09 __________________________________=20 Yahoo! Mail - PC Magazine Editors' Choice 2005=20 http://mail.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq -----Unmodified Original Message----- hi, there application crashes if lost connection during query (such as server is shuted down in immediate mode). it's due to that after connection closed, the socket flush funciton, SOCK_flush_output, is still trying to write/flush to the non-exist socket, during the socket destruction stage. the socket should be marked as "CLOSED" when connection is lost, such as, in socket.c UCHAR SOCK_get_next_byte(SocketClass *self) { ...... if (self->buffer_filled_in =3D=3D 0) { self->errornumber =3D SOCKET_CLOSED; self->errormsg =3D "Socket has been closed."; self->buffer_filled_in =3D 0; self->socket=3D-1; //@mark the socket "CLOSED"! return 0; } } return self->buffer_in[self->buffer_read_in++]; } =09 __________________________________=20 Yahoo! Mail - PC Magazine Editors' Choice 2005=20 http://mail.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq