if (bytestoread > p->imax) bytestoread = p->imax;
if (bytestoread > p->pipe_params.imax) bytestoread = p->pipe_params.imax;
static int readfromclient(struct pipe_params *p){	size_t bytestoread;	ssize_t r;	bytestoread = p->client_input.ceiling - p->client_input.end;	if (bytestoread > p->imax)		bytestoread = p->imax;	if (bytestoread == 0) {		log_d("readfromclient: bytestoread is zero!");		return 0;	}	r = recv(p->cfd, p->client_input.end, bytestoread, 0);	if (debug)		log_d("readfromclient: %d %d %d %d", p->cfd, p->client_input.end - p->client_input.floor, bytestoread, r);	switch (r) {	case -1:		switch (errno) {		default:			lerror("readfromclient");		case ECONNRESET:		case EPIPE:			p->error_condition = STUB_ERROR_CLIENT;			return -1;		case EAGAIN:			return 0;		}		break;	case 0:		log_d("readfromclient: client went away while posting data");		p->error_condition = STUB_ERROR_CLIENT;		return -1;	default:		p->t = current_time;		p->cn->nread += r;		p->client_input.end += r;		p->imax -= r;		break;	}	return 0;}