pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
app crashes if lost connection during query, seems to be a bug.
2+ messages / 2 participants
[nested] [flat]

* app crashes if lost connection during query, seems to be a bug.
@ 2005-10-07 21:26  doggie tame <tame_doggie@yahoo.com>
  0 siblings, 0 replies; 2+ messages in thread

From: doggie tame @ 2005-10-07 21:26 UTC (permalink / raw)
  To: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: app crashes if lost connection during query, seems to be a bug.
@ 2005-10-07 22:13  Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2005-10-07 22:13 UTC (permalink / raw)
  To: tame_doggie@yahoo.com; pgsql-odbc


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
 
-----Original Message-----
From: "doggie tame"<tame_doggie@yahoo.com>
Sent: 07/10/05 22:32:19
To: "pgsql-odbc@postgresql.org"<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 == 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

---------------------------(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 == 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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-10-07 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-07 21:26 app crashes if lost connection during query, seems to be a bug. doggie tame <tame_doggie@yahoo.com>
2005-10-07 22:13 Re: app crashes if lost connection during query, seems to be a bug. Dave Page <dpage@vale-housing.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox