nomask static int read_resource(object request, object response,
nomask static int read_resource(Request request, Response response,
nomask static int read_resource(object request, object response,						int offset, int length){	int i, anonymous;	string fn;	string webroot;	webroot = get_owner()->get_application()->get_webroot();	if(offset != -1) {		i = offset;	} else {		i = 0;	}	fn = request->get_uri()->get_absolute_filename();/*	rlimits( 0; -1)*/	{		if(response->get_read_on_demand() == FALSE) {			int size;			size = (int)response->get_header("Content-Length");			do {				response->add_content(f::read_file(fn, i, HTTP_CHUNK_SIZE));				i += HTTP_CHUNK_SIZE;			} while(i < size);		} else {			int bytes_done, tmp_read;			bytes_done = 0;			do {				if((length - bytes_done) > HTTP_CHUNK_SIZE) {					tmp_read = HTTP_CHUNK_SIZE;				} else {					tmp_read = length;				}				/* TODO: Don't read past end of file.  */				response->add_content(f::read_file(fn, i+bytes_done, tmp_read));				bytes_done += tmp_read;			} while(bytes_done < length);		}	}	return TRUE;}