apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guenter Knauf <efl...@gmx.net>
Subject question about buf type in apr_socket_recv(()
Date Wed, 28 Jul 2004 18:39:06 GMT

in apr_networ_io.h is defined:

 * Read data from a network.
 * @param sock The socket to read the data from.
 * @param buf The buffer to store the data in. 
 * @param len On entry, the number of bytes to receive; on exit, the number
 *            of bytes received.
 * @remark
 * <PRE>
 * This functions acts like a blocking read by default.  To change 
 * this behavior, use apr_socket_timeout_set().
 * The number of bytes actually sent is stored in argument 3.
 * It is possible for both bytes to be received and an APR_EOF or
 * other error to be returned.
 * APR_EINTR is never returned.
 * </PRE>
APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, 
                                   char *buf, apr_size_t *len);

I wonder that the comment mentions about bytes, but then the buf is type char...? 

Wouldnt this be more correct:

APR_DECLARE(apr_status_t) apr_socket_recv(apr_socket_t *sock, 
                                   apr_byte_t *buf, apr_size_t *len);


View raw message