src/dps8/fnpuv.c
//
// fuv_read_cb: libuv read complete callback
//
//   Cleanup on read error.
//   Forward data to appropriate handler.
libuv read complete callback
Cleanup on read error.
Forward data to appropriate handler.
libuv read complete callback Cleanup on read error . Forward data to appropriate handler .
static void fuv_read_cb (uv_stream_t* stream,
                         ssize_t nread,
                         const uv_buf_t* buf)
  {
    if (nread < 0)
      {
        if (nread == UV_EOF)
          {
            close_connection (stream);
          }
      }
    else if (nread > 0)
      {
        uvClientData * p = (uvClientData *) stream->data;
        if (p)
          {
            if (p->telnetp)
              {
                telnet_recv (p->telnetp, buf->base, (size_t) nread);
              }
            else
              {
                if (p -> assoc)
                  {
                    fnpuv_associated_readcb ((uv_tcp_t *) stream, nread, (unsigned char *) buf->base);
                  }
                else
                  {
                    fnpuv_unassociated_readcb ((uv_tcp_t *) stream, nread, (unsigned char *) buf->base);
                  }
              }
          }
      }
    if (buf->base)
        free (buf->base);
  }
static void fuv_read_cb ( uv_stream_t * stream , ssize_t nread , const uv_buf_t * buf ) { if ( nread < 0 ) { if ( nread == UV_EOF ) { close_connection ( stream ) ; } } else if ( nread > 0 ) { uvClientData * p = ( uvClientData * ) stream -> data ; if ( p ) { if ( p -> telnetp ) { telnet_recv ( p -> telnetp , buf -> base , ( size_t ) nread ) ; } else { if ( p -> assoc ) { fnpuv_associated_readcb ( ( uv_tcp_t * ) stream , nread , ( unsigned char * ) buf -> base ) ; } else { fnpuv_unassociated_readcb ( ( uv_tcp_t * ) stream , nread , ( unsigned char * ) buf -> base ) ; } } } } if ( buf -> base ) free ( buf -> base ) ; }
fuv_read_cb: libuv read complete callback
Cleanup on read error.
fuv_read_cb : libuv read complete callback Cleanup on read error .