if (debug) log_d("write_connection: %d %d %d %d", cn->fd, p->start - p->floor, n, m);
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) {			init_pool(p);			n = fill_connection(cn);			if (n <= 0) {				if (n == 0 && cn->keepalive)					reinit_connection(cn);				else					set_connection_state(cn, HC_CLOSING);				return;			}		}		cn->t = current_time;		m = send(cn->fd, p->start, n, 0);		if (m == -1) {			switch (errno) {			default:				log_d("error sending to %s[%hu]", inet_ntoa(cn->peer.sin_addr), ntohs(cn->peer.sin_port));				lerror("send");			case ECONNRESET:			case EPIPE:				set_connection_state(cn, HC_CLOSING);			case EAGAIN:				return;			}		}		cn->nwritten += m;		p->start += m;	} while (n == m);}