39 static const char* tcp_str =
"tcp";
115 ssize_t received = 0;
122 if (received == -1) {
123 if (errno == EAGAIN || errno == EINTR) {
127 if (errno != ECONNRESET) {
133 }
else if (received == 0) {
146 ods_log_error(
"[%s] packet too big, dropping connection", tcp_str);
155 if (received == -1) {
156 if (errno == EAGAIN || errno == EINTR) {
160 if (errno != ECONNRESET) {
166 }
else if (received == 0) {
193 uint16_t sendlen = htons(tcp->
msglen);
194 sent = write(tcp->
fd, (
const char*)&sendlen + tcp->
total_bytes,
197 if (errno == EAGAIN || errno == EINTR) {
215 if (errno == EAGAIN || errno == EINTR) {
240 if (!conn || !allocator) {
256 if (!set || !allocator) {
260 tcp_conn_cleanup(set->
tcp_conn[i], allocator);