SYSLOG("call_method failed; disconnecting\n");
static int receive_request(string request_string){	int ret;	object request, response;	string hostname;	rlimits(50; 16000000) { ticks_reqgen = AssessCost();#ifdef VERBOSE_IO_DEBUG	SYSLOG("--------------- REQUEST ---------------\n");	SYSLOG("From: " + ip_name() + " (" + ip_number() + ")\n" + request_string);	SYSLOG("------------ END OF REQUEST -----------\n");#endif	ret = MODE_NOCHANGE;	/* Get which application to use (as early as possible) */	if(sscanf(request_string, "%*sHost: %s\r\n%*s", hostname) == 3) {		if(index_of(0, hostname, ":") != -1) {			/* *sigh* Ugly fix. */			hostname = explode(hostname, ":")[0];		}		set_application(server->get_application(hostname, get_port()));	} else {		set_application(server->get_application("", get_port()));	}	/* create a request object */	request = create_request(request_string);	if(request == nil) {		SYSLOG("request is nil (but stored in pending), incoming data\n");		return MODE_NOCHANGE;	}#ifdef LIMITED_IO_DEBUG	SYSLOG("req: " + 				"[" + ip_number() + "] " + 				app->get_hostname() + ":" + 				app->get_port() + ", " + 				request->get_command() + " " +				request->get_uri()->get_relative_path() + 				request->get_uri()->get_filename() + ", " +				"len: " + request->get_content_length() +				"\n"			);#endif		/* create a response object */	response = create_response(request);	app->http_log(request, response);	if(response == nil) {		/* we got a content body with request, dealing with that */		SYSLOG("user->receive_request(), response is nil\n");	} else {		if(call_method(request, response) == FALSE) {			ret = MODE_DISCONNECT;			SYSLOG("call_method failed; disconnecting\n");		}	}	if(!keep_alive && response->contents_buffered() == FALSE) {		ret = MODE_DISCONNECT;	}	ticks_reqgen = GetCost(ticks_reqgen); }	OutputCost("Request cost", ticks_reqgen);	return ret;}