Пример #1
0
		//deallocate resources after a request has been completed
		void cleanup() {
			server->performanceCounters.totalRequestsFinished++;
			thr.performanceCounters.totalRequestsFinished++;
			req.reset();
			resp->reset();
			thr._responsePool.put(resp);
			resp=nullptr;
			sp.clear();
		}
Пример #2
0
		void finalize() {
			thr.performanceCounters.totalRequestsFinished++;
			if(resp->closed) {
				destruct(); return;
			}
			req.reset();
			resp->reset();
			thr._responsePool.put(resp);
			resp=nullptr;
			sp.clear();
			if(keepAlive) {
				req.init(s,&sp);
				if(req.readRequest({&handler::readCB,this})) readCB(true);
			} else {
				s.shutdown(SHUT_WR);
				buf=(uint8_t*)malloc(4096);
				s.repeatRead(buf,4096,{&handler::sockReadCB,this});
			}
		}