예제 #1
0
void Pillow::HttpClient::messageComplete()
{
	delete _contentDecoder;
	_contentDecoder = 0;

	if (statusCode() == 100)
	{
		// Completely hide and ignore the 100 response we just received.
		clear();
	}
	else
	{
		Pillow::HttpResponseParser::messageComplete();
		_responsePending = false;

		if (_keepAliveTimeout == 0)
			_device->close();
		else
		{
			if (!shouldKeepAlive())
				_device->close();

			_keepAliveTimeoutTimer.start();
		}

		emit finished();
	}
}
예제 #2
0
파일: HttpConnection.cpp 프로젝트: crnt/x0
/** Resumes processing the <b>next</b> HTTP request message within this connection.
 *
 * This method may only be invoked when the current/old request has been fully processed,
 * and is though only be invoked from within the finish handler of \p HttpRequest.
 *
 * \see HttpRequest::finish()
 */
void HttpConnection::resume()
{
	TRACE("resume() shouldKeepAlive:%d (insideSocketCB:%d)", shouldKeepAlive(), isInsideSocketCallback());
	TRACE("-- (status:%s, inputOffset:%ld, inputSize:%ld)", status_str(), inputOffset_, input_.size());

	status_ = KeepAliveRead;
	request_->clear();

	if (socket()->tcpCork())
		socket()->setTcpCork(false);
}
예제 #3
0
/** Resumes processing the <b>next</b> HTTP request message within this connection.
 *
 * This method may only be invoked when the current/old request has been fully processed,
 * and is though only be invoked from within the finish handler of \p HttpRequest.
 *
 * \see HttpRequest::finish()
 */
void HttpConnection::resume()
{
	TRACE(1, "resume() shouldKeepAlive:%d)", shouldKeepAlive());
	TRACE(1, "-- (status:%s, inputOffset:%lu, inputSize:%lu)", status_str(), inputOffset_, input_.size());

	setStatus(KeepAliveRead);
	request_->clear();

	if (socket()->tcpCork())
		socket()->setTcpCork(false);
}