37static const char* tcp_str =
"tcp";
105 ssize_t received = 0;
107 ods_log_assert(tcp->
fd != -1);
112 if (received == -1) {
113 if (errno == EAGAIN || errno == EINTR) {
117 if (errno != ECONNRESET) {
118 ods_log_error(
"[%s] error read() sz: %s", tcp_str,
123 }
else if (received == 0) {
136 ods_log_error(
"[%s] packet too big, dropping connection", tcp_str);
145 if (received == -1) {
146 if (errno == EAGAIN || errno == EINTR) {
150 if (errno != ECONNRESET) {
151 ods_log_error(
"[%s] error read(): %s", tcp_str,
156 }
else if (received == 0) {
181 ods_log_assert(tcp->
fd != -1);
183 uint16_t sendlen = htons(tcp->
msglen);
184 sent = write(tcp->
fd, (
const char*)&sendlen + tcp->
total_bytes,
187 if (errno == EAGAIN || errno == EINTR) {
205 if (errno == EAGAIN || errno == EINTR) {
size_t buffer_capacity(buffer_type *buffer)
void buffer_clear(buffer_type *buffer)
void buffer_cleanup(buffer_type *buffer)
uint8_t * buffer_current(buffer_type *buffer)
void buffer_set_limit(buffer_type *buffer, size_t limit)
size_t buffer_position(buffer_type *buffer)
void buffer_skip(buffer_type *buffer, ssize_t count)
size_t buffer_remaining(buffer_type *buffer)
buffer_type * buffer_create(size_t capacity)
#define PACKET_BUFFER_SIZE
xfrd_type * tcp_waiting_first
xfrd_type * tcp_waiting_last
tcp_conn_type * tcp_conn[TCPSET_MAX]
void tcp_conn_ready(tcp_conn_type *tcp)
void tcp_set_cleanup(tcp_set_type *set)
int tcp_conn_read(tcp_conn_type *tcp)
tcp_conn_type * tcp_conn_create()
int tcp_conn_write(tcp_conn_type *tcp)
tcp_set_type * tcp_set_create()