if (p->client_output.end > p->client_output.start && canwritetoclient) {
if (p->output.end > p->output.start && canwritetoclient) {
static void pipe_run(struct pipe_params *p){	short cevents, pevents;	int canwritetoclient, canwritetochild;	cevents = p->cpollno != -1 ? pollfds[p->cpollno].revents : 0;	pevents = p->ppollno != -1 ? pollfds[p->ppollno].revents : 0;	if (cevents & POLLERR) {		log_socket_error(p->cfd, "pipe_run: error on client socket");		p->error_condition = STUB_ERROR_CLIENT;		return;	}	if (pevents & POLLERR) {		log_socket_error(p->pfd, "pipe_run: error on child socket");		p->error_condition = STUB_ERROR_PIPE;		return;	}	cevents &= POLLIN | POLLOUT;	pevents &= POLLIN | POLLOUT;	canwritetoclient = cevents & POLLOUT || p->client_output.end == p->client_output.floor;	canwritetochild = pevents & POLLOUT || p->client_input.end == p->client_input.floor;	if (cevents & POLLIN) {		if (readfromclient(p) == -1)			return;	}	if (pevents & POLLIN) {		if (readfromchild(p) == -1)			return;	}	if (p->script_input.end && p->state != 2) {		if (scanlflf(p) == -1)			return;	}	if (p->state == 2 && p->script_input.start < p->script_input.end)		copychunk(p);	if (p->script_input.state == 2)		copylastchunk(p);	if (p->client_output.end > p->client_output.start && canwritetoclient) {		if (writetoclient(p) == -1)			return;	}	if (p->client_input.end > p->client_input.start && canwritetochild) {		if (writetochild(p) == -1)			return;	}}