switch (errno) { default: log_d("error writing to %s[%hu]", inet_ntoa(cn->peer.sin_addr), ntohs(cn->peer.sin_port));
if (errno == EAGAIN) return; if (debug)
static void write_connection(struct connection *cn){	struct pool *p;	int m, n;	p = &cn->output;	do {		n = p->end - p->start;		if (n == 0) {#if defined LINUX_SENDFILE || defined FREEBSD_SENDFILE			if (sendfile_connection(cn) == -1) {				close_connection(cn);				return;			}			if (cn->left == 0)		       		end_response(cn);			return;#else			p->start = p->end = p->floor;			n = fill_connection(cn);			if (n == -1) {				close_connection(cn);				return;			}			if (n == 0) {				end_response(cn);				return;			}#endif		}		m = write(cn->fd, p->start, n);		if (debug)			log_d("write_connection: %d %d %d %d", cn->fd, p->start - p->floor, n, m);		if (m == -1) {			switch (errno) {			default:				log_d("error writing to %s[%hu]", inet_ntoa(cn->peer.sin_addr), ntohs(cn->peer.sin_port));				lerror("write");			case ECONNRESET:			case EPIPE:				close_connection(cn);			case EAGAIN:				return;			}		}		cn->t = current_time;		cn->nwritten += m;		p->start += m;	} while (n == m);}