pixma_bjnp.c: added explicit error message for the case where the

scanner closes the TCP-connection
merge-requests/1/head
Louis Lagendijk 2014-08-23 14:36:05 +02:00
rodzic 3ce1cec6a3
commit b4856a8a31
1 zmienionych plików z 11 dodań i 5 usunięć

Wyświetl plik

@ -1455,12 +1455,18 @@ bjnp_recv_header (int devno, size_t *payload_size )
0)) != sizeof (struct BJNP_command))
{
terrno = errno;
PDBG (bjnp_dbg (LOG_CRIT,
"bjnp_recv_header: ERROR - (recv) could not read response header, received %d bytes!\n",
if (recv_bytes == 0)
{
PDBG (bjnp_dbg (LOG_CRIT,
"bjnp_recv_header: ERROR - (recv) Scanner closed the TCP-connection!\n"));
} else {
PDBG (bjnp_dbg (LOG_CRIT,
"bjnp_recv_header: ERROR - (recv) could not read response header, received %d bytes!\n",
recv_bytes));
PDBG (bjnp_dbg
(LOG_CRIT, "bjnp_recv_header: ERROR - (recv) error: %s!\n",
strerror (terrno)));
PDBG (bjnp_dbg
(LOG_CRIT, "bjnp_recv_header: ERROR - (recv) error: %s!\n",
strerror (terrno)));
}
errno = terrno;
return SANE_STATUS_IO_ERROR;
}