if (ret < 0)
goto out;
fd = ret;
- ret = send_bin_buffer(fd, buf, sizeof(buf));
+ ret = write_all(fd, buf, sizeof(buf));
if (ret < 0)
goto out;
/*
no_admissible_files:
*(uint32_t *)buf = NO_ADMISSIBLE_FILES;
*(uint32_t *)(buf + 4) = (uint32_t)0;
- return send_bin_buffer(server_socket, buf, 8);
+ return write_all(server_socket, buf, 8);
}
/* Never fails if arg == NULL */
ret = shm_detach(shm);
if (ret < 0)
goto err;
- ret = send_bin_buffer(fd, (char *)&shmid, sizeof(int));
+ ret = write_all(fd, (char *)&shmid, sizeof(int));
if (ret >= 0)
return ret;
err:
SESSION_KEY_LEN);
hash_to_asc(challenge_hash, buf);
PARA_INFO_LOG("--> %s\n", buf);
- ret = send_bin_buffer(ct->scc.fd, (char *)challenge_hash,
- HASH_SIZE);
+ ret = write_all(ct->scc.fd, (char *)challenge_hash, HASH_SIZE);
if (ret < 0)
goto out;
ct->status = CL_SENT_CH_RESPONSE;
}
PARA_DEBUG_LOG("sending %u byte challenge + rc4 keys (%zu bytes)\n",
CHALLENGE_SIZE, numbytes);
- ret = send_bin_buffer(fd, buf, numbytes);
+ ret = write_all(fd, buf, numbytes);
if (ret < 0)
goto net_err;
/* recv challenge response */
return ia;
}
-/**
- * Send a binary buffer.
- *
- * \param fd The file descriptor.
- * \param buf The buffer to be sent.
- * \param len The length of \a buf.
- *
- * Send out the buffer and try to resend the remaining part in case of short
- * writes.
- *
- * \return Standard.
- */
-int send_bin_buffer(int fd, const char *buf, size_t len)
-{
- if (!len)
- PARA_CRIT_LOG("len == 0\n");
- return write_all(fd, buf, len);
-}
-
/**
* Send a \p NULL-terminated buffer.
*
* \param fd The file descriptor.
* \param buf The null-terminated buffer to be send.
*
- * This is equivalent to send_bin_buffer(fd, buf, strlen(buf)).
+ * This is equivalent to write_all(fd, buf, strlen(buf)).
*
* \return Standard.
*/
int send_buffer(int fd, const char *buf)
{
- return send_bin_buffer(fd, buf, strlen(buf));
+ return write_all(fd, buf, strlen(buf));
}
/**
*/
extern int generic_max_transport_msg_size(int sockfd);
-int send_bin_buffer(int, const char *, size_t);
int send_buffer(int, const char *);
__printf_2_3 int send_va_buffer(int fd, const char *fmt, ...);