src/client.c
/** called by worker when sd is ready to read */
called by worker when sd is ready to read
called by worker when sd is ready to read
void c_recv(client_st *p)
{
    if (!p->recv_ready) { return; }
    p->recv_ready = 0;
    int rv;
    unsigned char *buf;
    unsigned int len;
    if (p->is_tls) {
        buf = tls_recv_buf;
        len = sizeof(tls_recv_buf);
    }
    else {
        buf = c_recv_buf;
        len = sizeof(c_recv_buf);
    }
    rv = c_recv_wire(p, buf, len);
    if (rv <= 0) {
        return;
    }
    if (p->is_tls) {
        tls_recv(p, buf, rv);
        return;
    }
    else if (p->is_ws) {
        c_ws_recv(p, buf, rv);
    }
    else {
        c_parse(p, buf, rv);
    }
}
void c_recv ( client_st * p ) { if ( ! p -> recv_ready ) { return ; } p -> recv_ready = 0 ; int rv ; unsigned char * buf ; unsigned int len ; if ( p -> is_tls ) { buf = tls_recv_buf ; len = sizeof ( tls_recv_buf ) ; } else { buf = c_recv_buf ; len = sizeof ( c_recv_buf ) ; } rv = c_recv_wire ( p , buf , len ) ; if ( rv <= 0 ) { return ; } if ( p -> is_tls ) { tls_recv ( p , buf , rv ) ; return ; } else if ( p -> is_ws ) { c_ws_recv ( p , buf , rv ) ; } else { c_parse ( p , buf , rv ) ; } }
called by worker when sd is ready to read
called by worker when sd is ready to read