@ -343,9 +343,22 @@ SocketBackend(StringInfo inBuf)
if ( qtype = = EOF ) /* frontend disconnected */
if ( qtype = = EOF ) /* frontend disconnected */
{
{
ereport ( COMMERROR ,
if ( IsTransactionState ( ) )
( errcode ( ERRCODE_PROTOCOL_VIOLATION ) ,
ereport ( COMMERROR ,
errmsg ( " unexpected EOF on client connection " ) ) ) ;
( errcode ( ERRCODE_CONNECTION_FAILURE ) ,
errmsg ( " unexpected EOF on client connection with an open transaction " ) ) ) ;
else
{
/*
* Can ' t send DEBUG log messages to client at this point .
* Since we ' re disconnecting right away , we don ' t need to
* restore whereToSendOutput .
*/
whereToSendOutput = DestNone ;
ereport ( DEBUG1 ,
( errcode ( ERRCODE_CONNECTION_DOES_NOT_EXIST ) ,
errmsg ( " unexpected EOF on client connection " ) ) ) ;
}
return qtype ;
return qtype ;
}
}
@ -366,9 +379,22 @@ SocketBackend(StringInfo inBuf)
/* old style without length word; convert */
/* old style without length word; convert */
if ( pq_getstring ( inBuf ) )
if ( pq_getstring ( inBuf ) )
{
{
ereport ( COMMERROR ,
if ( IsTransactionState ( ) )
( errcode ( ERRCODE_PROTOCOL_VIOLATION ) ,
ereport ( COMMERROR ,
errmsg ( " unexpected EOF on client connection " ) ) ) ;
( errcode ( ERRCODE_CONNECTION_FAILURE ) ,
errmsg ( " unexpected EOF on client connection with an open transaction " ) ) ) ;
else
{
/*
* Can ' t send DEBUG log messages to client at this
* point . Since we ' re disconnecting right away , we
* don ' t need to restore whereToSendOutput .
*/
whereToSendOutput = DestNone ;
ereport ( DEBUG1 ,
( errcode ( ERRCODE_CONNECTION_DOES_NOT_EXIST ) ,
errmsg ( " unexpected EOF on client connection " ) ) ) ;
}
return EOF ;
return EOF ;
}
}
}
}