}
/*
- * Send out a buffer, resend on short writes.
+ * Write a buffer to a file descriptor, re-write on short writes.
*
* \param fd The file descriptor.
* \param buf The buffer to be sent.
* \param len The length of \a buf.
*
- * \return Standard. In any case, the number of bytes actually sent is stored
- * in \a len.
+ * \return Standard. In any case, the number of bytes that have been written is
+ * stored in \a len.
*/
-static int sendall(int fd, const char *buf, size_t *len)
+static int write_all(int fd, const char *buf, size_t *len)
{
size_t total = *len;
/* RC4 may write more than len to the output buffer */
unsigned char *outbuf = para_malloc(ROUND_UP(len, 8));
(*cf)(len, (unsigned char *)buf, outbuf, private);
- ret = sendall(fd, (char *)outbuf, &len);
+ ret = write_all(fd, (char *)outbuf, &len);
free(outbuf);
} else
- ret = sendall(fd, buf, &len);
+ ret = write_all(fd, buf, &len);
return ret;
}