Skip site navigation (1) Skip section navigation (2)

app crashes if lost connection during query, seems to be a bug.

From: doggie tame <tame_doggie(at)yahoo(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: app crashes if lost connection during query, seems to be a bug.
Date: 2005-10-07 21:26:19
Message-ID: 20051007212619.71296.qmail@web30012.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-odbc
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 == 0)
         {
             self->errornumber = SOCKET_CLOSED;
             self->errormsg = "Socket has been
closed.";
             self->buffer_filled_in = 0;
             self->socket=-1; //@mark the socket
"CLOSED"!
             return 0;
         }
     }
     return self->buffer_in[self->buffer_read_in++];
}


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

pgsql-odbc by date

Next:From: Dave PageDate: 2005-10-07 22:13:11
Subject: Re: app crashes if lost connection during query, seems to be a bug.
Previous:From: doggie tameDate: 2005-10-07 18:31:34
Subject:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group