src/raw_sock.c
int raw_sock_from_pipe(struct connection *conn, struct pipe *pipe)
{
	int ret, done;

	done = 0;
	while (pipe->data) {
		ret = splice(pipe->cons, NULL, conn->t.sock.fd, NULL, pipe->data,
			     SPLICE_F_MOVE|SPLICE_F_NONBLOCK);

		if (ret <= 0) {
			if (ret == 0 || errno == EAGAIN) {
				__conn_data_poll_send(conn);
				break;
			}
			else if (errno == EINTR)
				continue;

			/* here we have another error */
			conn->flags |= CO_FL_ERROR;
			break;
		}

		done += ret;
		pipe->data -= ret;
	}
	if (unlikely(conn->flags & CO_FL_WAIT_L4_CONN) && done)
		conn->flags &= ~CO_FL_WAIT_L4_CONN;
	return done;
}
/* Send as many bytes as possible from the pipe to the connection's socket.
 */
Send as many bytes as possible from the pipe to the connection's socket.
Send as many bytes as possible from the pipe to the connection ' s socket .
int raw_sock_from_pipe(struct connection *conn, struct pipe *pipe)
{
	int ret, done;
	done = 0;
	while (pipe->data) {
		ret = splice(pipe->cons, NULL, conn->t.sock.fd, NULL, pipe->data,
			     SPLICE_F_MOVE|SPLICE_F_NONBLOCK);
		if (ret <= 0) {
			if (ret == 0 || errno == EAGAIN) {
				__conn_data_poll_send(conn);
				break;
			}
			else if (errno == EINTR)
				continue;
			conn->flags |= CO_FL_ERROR;
			break;
		}
		done += ret;
		pipe->data -= ret;
	}
	if (unlikely(conn->flags & CO_FL_WAIT_L4_CONN) && done)
		conn->flags &= ~CO_FL_WAIT_L4_CONN;
	return done;
}
int raw_sock_from_pipe ( struct connection * conn , struct pipe * pipe ) { int ret , done ; done = 0 ; while ( pipe -> data ) { ret = splice ( pipe -> cons , NULL , conn -> t . sock . fd , NULL , pipe -> data , SPLICE_F_MOVE | SPLICE_F_NONBLOCK ) ; if ( ret <= 0 ) { if ( ret == 0 || errno == EAGAIN ) { __conn_data_poll_send ( conn ) ; break ; } else if ( errno == EINTR ) continue ; conn -> flags |= CO_FL_ERROR ; break ; } done += ret ; pipe -> data -= ret ; } if ( unlikely ( conn -> flags & CO_FL_WAIT_L4_CONN ) && done ) conn -> flags &= ~ CO_FL_WAIT_L4_CONN ; return done ; }
Send as many bytes as possible from the pipe to the connection's socket.
Send as many bytes as possible from the pipe to the connection ' s socket .
/* here we have another error */