VCL-LDPRELOAD: Fix CID179207

Change-Id: Ia6b9e39d5a2ef064cf71bfe87cb4b4a0648d735d
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
This commit is contained in:
Dave Wallace
2017-11-19 11:20:02 -05:00
parent cabbee7d8c
commit e376f93398
2 changed files with 19 additions and 4 deletions

View File

@ -1557,8 +1557,17 @@ vcom_socket_sendfile (int __out_fd, int __in_fd, off_t * __offset,
do do
{ {
bytes_to_read = vppcom_session_attr (out_sid, rv = vppcom_session_attr (out_sid, VPPCOM_ATTR_GET_NWRITE, 0, 0);
VPPCOM_ATTR_GET_NWRITE, 0, 0); if (rv < 0)
{
clib_warning ("[%d] ERROR: vppcom_session_attr (out_sid (%u), "
"VPPCOM_ATTR_GET_NWRITE, 0, 0) returned %d (%s)!",
getpid (), out_sid, rv, vppcom_retval_str (rv));
vec_reset_length (vsm->io_buffer);
return rv;
}
bytes_to_read = (size_t) rv;
if (VCOM_DEBUG > 2) if (VCOM_DEBUG > 2)
clib_warning ("[%d] results %ld, n_bytes_left %lu, " clib_warning ("[%d] results %ld, n_bytes_left %lu, "
"bytes_to_read %lu", getpid (), results, "bytes_to_read %lu", getpid (), results,
@ -1606,8 +1615,10 @@ vcom_socket_sendfile (int __out_fd, int __in_fd, off_t * __offset,
if (rv < 0) if (rv < 0)
{ {
clib_warning ("[%d] ERROR: vppcom_session_write (" clib_warning ("[%d] ERROR: vppcom_session_write ("
"out_sid %u, io_buffer %p, nbytes %d) returned %d", "out_sid %u, io_buffer %p, nbytes %d) "
getpid (), out_sid, vsm->io_buffer, nbytes, rv); "returned %d (%s)",
getpid (), out_sid, vsm->io_buffer, nbytes,
rv, vppcom_retval_str (rv));
if (results == 0) if (results == 0)
{ {
vec_reset_length (vsm->io_buffer); vec_reset_length (vsm->io_buffer);

View File

@ -103,6 +103,10 @@ vppcom_retval_str (int retval)
st = "VPPCOM_EAGAIN"; st = "VPPCOM_EAGAIN";
break; break;
case VPPCOM_ENOMEM:
st = "VPPCOM_ENOMEM";
break;
case VPPCOM_EINVAL: case VPPCOM_EINVAL:
st = "VPPCOM_EINVAL"; st = "VPPCOM_EINVAL";
break; break;