src/client.c
/** read from socket into buf up to len,
 * return -1 on error, otherwise number of bytes read
 */
read from socket into buf up to len,
return -1 on error, otherwise number of bytes read
read from socket into buf up to len return - 1 on error otherwise number of bytes read
int c_recv_wire(client_st *p, unsigned char *buf, int len)
{
    int rv;
    rv = recv(p->sd, buf, len, 0);
    if (rv == 0 || (rv < 0 && errno != EAGAIN)) {
        snprintf(l_reason, sizeof(l_reason), "recv failed rv %d, errno %d (%s)",
                rv, errno, strerror(errno));
        c_disconnect(p, l_reason);
        return -1;
    }
    return rv;
}
int c_recv_wire ( client_st * p , unsigned char * buf , int len ) { int rv ; rv = recv ( p -> sd , buf , len , 0 ) ; if ( rv == 0 || ( rv < 0 && errno != EAGAIN ) ) { snprintf ( l_reason , sizeof ( l_reason ) , " " , rv , errno , strerror ( errno ) ) ; c_disconnect ( p , l_reason ) ; return -1 ; } return rv ; }
read from socket into buf up to len,
 return -1 on error, otherwise number of bytes read
read from socket into buf up to len return - 1 on error otherwise number of bytes read