--- include/apr_network_io.h (revision 572605) +++ include/apr_network_io.h (working copy) @@ -508,6 +508,33 @@ apr_size_t *len); /** + * Send multiple packets of data over a network. + * @param sock The socket to send the data over. + * @param where The apr_sockaddr_t describing where to send the data + * @param flags The flags to use + * @param vec The array of iovec structs containing the data to send + * @param nvec The number of iovec structs in the array + * @param len Receives the number of bytes actually written + * @remark + *
+ * This functions acts like a blocking write by default.  To change 
+ * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK
+ * socket option.
+ * The number of bytes actually sent is stored in argument 3.
+ *
+ * It is possible for both bytes to be sent and an error to be returned.
+ *
+ * APR_EINTR is never returned.
+ * 
+ */ +APR_DECLARE(apr_status_t) apr_socket_sendtov(apr_socket_t *sock, + apr_sockaddr_t *where, + apr_int32_t flags, + const struct iovec *vec, + apr_int32_t nvec, + apr_size_t *len); + +/** * Read data from a socket. On success, the address of the peer from * which the data was sent is copied into the @param from parameter, * and the @param len parameter is updated to give the number of bytes --- network_io/unix/sendrecv.c (revision 572605) +++ network_io/unix/sendrecv.c (working copy) @@ -184,7 +184,15 @@ return APR_SUCCESS; } -apr_status_t apr_socket_sendv(apr_socket_t * sock, const struct iovec *vec, +apr_status_t apr_socket_sendtov(apr_socket_t *sock, apr_sockaddr_t *where, + apr_int32_t flags, const struct iovec *vec, + apr_int32_t nvec, apr_size_t *len) +{ + *len = vec[0].iov_len; + return apr_socket_sendto(sock, where, flags, vec[0].iov_base, len); +} + +apr_status_t apr_socket_sendv(apr_socket_t *sock, const struct iovec *vec, apr_int32_t nvec, apr_size_t *len) { #ifdef HAVE_WRITEV