if (debug) log_d("writetoclient: fd=%d, obp=%d, otop=%d, r=%d", p->cfd, p->obp, p->otop, r);
static int writetoclient(struct pipe_params *p){	ssize_t r;	r = send(p->cfd, p->obuf + p->obp, p->otop - p->obp, 0);	switch (r) {	case -1:		switch (errno) {		case EAGAIN:			break;		default:			lerror("pipe_run: error writing to client");		case EPIPE:		case ECONNRESET:			p->error_condition = STUB_ERROR_CLIENT;			return -1;		}		break;	default:		p->t = current_time;		p->cn->nwritten += r;		p->obp += r;		if (p->obp == p->otop)			p->obp = p->otop = 0;		break;	}	return 0;}