Example #1
0
    void tryTakeRequest()
    {
        if(maxWorkers != -1 && requestSessions.count() >= maxWorkers)
            return;

        M2Request *req = m2->takeNext();
        if(!req)
            return;

        RequestSession *rs = new RequestSession(inspect, inspectChecker, this);
        connect(rs, SIGNAL(inspected(const InspectData &)), SLOT(rs_inspected(const InspectData &)));
        connect(rs, SIGNAL(inspectError()), SLOT(rs_inspectError()));
        connect(rs, SIGNAL(finished()), SLOT(rs_finished()));
        connect(rs, SIGNAL(finishedForAccept(const AcceptData &)), SLOT(rs_finishedForAccept(const AcceptData &)));

        requestSessions += rs;

        rs->start(req);
    }
Example #2
0
	void tryTakeRequest()
	{
		if(!canTake())
			return;

		ZhttpRequest *req = zhttpIn->takeNextRequest();
		if(!req)
			return;

		RequestSession *rs = new RequestSession(domainMap, sockJsManager, inspect, inspectChecker, accept, this);
		connect(rs, SIGNAL(inspected(const InspectData &)), SLOT(rs_inspected(const InspectData &)));
		connect(rs, SIGNAL(inspectError()), SLOT(rs_inspectError()));
		connect(rs, SIGNAL(finished()), SLOT(rs_finished()));
		connect(rs, SIGNAL(finishedByAccept()), SLOT(rs_finishedByAccept()));

		rs->setAutoCrossOrigin(config.autoCrossOrigin);

		requestSessions += rs;

		rs->start(req);
	}